This question already has an answer here:

I have little free disk space.

Why shouldn't you use DBCC SHRINKDATABASE (DBName, TRUNCATEONLY) after every rebuild/reindex operation?

marked as duplicate by LowlyDBA, McNets, Max Vernon sql-server Nov 15 '18 at 20:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Why wouldn't you move extra chairs out to your garage every time you have a meal with fewer people? You're just going to have to move them back when you need them again. Also please read all of this. – Aaron Bertrand Nov 15 '18 at 13:26

Because your database will grow again. You are not fixing anything by shrinking, because as you stated, it will grow out after the next rebuild operation anyway.

What are you going to do when you run out of free space before your next rebuild operation? Or you cannot run your rebuild / reindex anymore because of the limited disk space?

Shrinking use cases are very limited, and is considered a bad practice, not only because your db will grow out again.

Take a look at this Question for more info why you should not do this.

I suggest adding space to your disk / adding a new disk and moving your data to that disk if you can't add more space.

Also, there are some valid reasons as to not defrag your indexes:


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