Drop auto statistics after an upgrade/migration
- Adam Thurgar
- Feb 3, 2018
- 1 min read
In a recent blog on database corruption I mentioned that I had dropped all the statistical indexes and let the optimizer recreate them as required.
I find that this is also required if you do an upgrade of your SQL Server installation (in place or backup/restore). The reason for this is that the auto statistics were created under a certain version of the optimizer. Now if you take these old auto statistics it may cause the new optimizer to make less than optimal decisions, plus it always better to start with a clean plate. One database that we migrated to SQL Server 2014 had over 100,00 auto statistic. Not sure how many of these were used but better that we got rid of that old baggage and let the optimizer create new ones, as it required them. Initially there will be an overhead, but much better in the long run.
The following link is very useful.
https://blogs.msdn.microsoft.com/mvpawardprogram/2013/09/09/sql-server-auto-statistics-cleanup/

Comments