Tip #511: Should you shrink your MSCRM database?

So you delete a bunch of records from your CRM database, but the size of the data file is still its original size. Should you shrink the MSCRM database?

No. OK, I mean rarely.

When this topic comes up, I always point people to the classic Why you should not shrink your data files by Paul S Randal. Paul is a SQL Server MVP and former program manager for SQL server 2008 at Microsoft. As one of the people responsible for the shrink button, he knows what he is talking about.

His recommendation for moving tables to different file groups is not supported when dealing with MSCRM databases, but his warnings are valid. Does this mean that you should never ever shrink your database size? There definitely are cases where shrinking your database makes sense. For example, if you are almost out of space on your SQL server with no good options to increase it, shrinking may be your only option. Say you had a data load go bad and create a million records that you don’t need, and your database will never grow to that size again. After you delete the records, shrinking won’t be the end of the world as long as you can take the time to rebuild your fragmented indexes afterwards.

However, if your database has grown through normal usage, and you are running out of space, shrinking the database will only be a temporary bandage, and in that case, your database will quickly regrow to its bloated size. Instead of shrinking the database, invest in more storage.


Leave a Reply

Your email address will not be published. Required fields are marked *