Reputation: 9658
I executed an Index Rebuild for a large table in database because it was 85% fragmented. After the Index Rebuild finished the database file size has grown from 19 GB to 27 GB.
Rebuild option:
(PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = ON, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
My Question : Is there any solution to decrease database file size without increase index fragmentation?
Upvotes: 0
Views: 1250
Reputation: 26
You should have enough free space on database data file
You should set auto-growth to a sensible size based database daily increase size
The increase in database size due to the index rebuilt is expected.
Upvotes: 1
Reputation: 211
You can always try to shrink the datafile, but as you mention you could get fragmentation on that. I'd say, keep your datafiles the size they are, they are not so big and you will have some space to grow your DB.
Upvotes: 0