Andrew
Andrew

Reputation: 2969

SQL Reindex has made my database twice as big

I have reindexed all my table in a database that was 22GB, it is now 42GB, Any ideas why this has happened and is it possible to shrink it back down to its original size. This is just the .mdf file, not the .ldf file. It cant double in size and stay like that surely?

Cheers Andrew

Upvotes: 0

Views: 467

Answers (1)

Emka
Emka

Reputation: 350

The increase in database size due to the index rebuilt is expected. While the index is rebuilt, parallel indexing structure is created and after it is created it switches as new cluster index. So, we need free space in a database. If you try to shrink the size of the database then you would unnecessarily waste the effort of shrinking it as the size will increase again when you rebuild the index again. So, if you have to have index rebuild in your maintenance task then you should allow your database to have enough space.

Source social.msdn.microsoft.com

Upvotes: 1

Related Questions