0

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!

0

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.

  • Wouldn't you want as many pages in memory for an active OLTP database (granted - that was not stated), but shrinking a db data file once in a while, especially after removing a significant amount of data, would get more pages into memory, wouldn't it? – Bill Cummings Mar 9 '18 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.