should I shrink the filegroup? how? SQL Server

Posted on

Question :

I just have a question. We recently purged 1,5 millions of record from a table. The Current allocated space for the related Filegroup is 700GB, but the space Used is 300GB. Should I perform a shrink for this particular case in order to reduce the Allocated space /disk size? How can we do it? because it is an .ndf file, I have never shrink an .ndf file. Thanks in advance!

Answer :

Why would you?

I mean, the disk is there for you to use, and as I guess the server in which the database runs is devoted to it, there is no real reason to give the space back to the OS just to have the OS allocate it again to the same datafiles in the future.

Shrinking is in general not a really good idea, when you do it, you risk facing fragmentation issues which will hurt your performance.

In case you have a good reason to do it DBCC SHRINKFILE(yourfile) is what you need.

Leave a Reply

Your email address will not be published. Required fields are marked *