I have little free disk space.
Why shouldn't you use DBCC SHRINKDATABASE (DBName, TRUNCATEONLY)
after every rebuild/reindex operation?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityI have little free disk space.
Why shouldn't you use DBCC SHRINKDATABASE (DBName, TRUNCATEONLY)
after every rebuild/reindex operation?
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:
https://groupby.org/conference-session-abstracts/why-defragmenting-your-indexes-isnt-helping/