Ian Jose's WebLog

This weblog is intended to help T-SQL developers get the best performing query plans from SQL Server. Some of the posts describe simple mistakes that can be easily avoided. Other posts describe complex solutions to limitations in SQL Server. Lastly, some posts describe recent improvements in SQL Server, and the means to employ them best.

Auto-create and Auto-update Statistics

For a large majority of SQL Server installations, the most important best practice is to use auto create and auto update statistics database-wide. Auto create and auto update statistics are on by default. If you observe bad plans and suspect that missing or out of date statistics are at fault, verify that auto create and auto update statistics are on.

An alternative to enabling auto create statistics is enabled or make sure to manually create statistics using CREATE STATISTICS or sp_createstats.  Note that auto-statistics will not work for read-only databases.

Published Thursday, November 10, 2005 2:01 PM by ianjo

Comments

 

Tips, Tricks, and Advice from the SQL Server Query Processing Team said:

Since we’re starting a new blog for the whole query processing team, we think it’s appropriate to start...
September 25, 2006 8:50 PM
 

msdngtnexus said:

Is there any way to to auto create and auto update statistics at "fullscan" or at "50% sample" all the time.

Most of the specificity/density calculations for columns/indexes for our tables are completely skewed when they are sampled at the default sampling ratio. As a result our query plans get shot after that.  Right now, we are writing scripts to recompute stats at fullscan periodically. That doesnt seem right.

I want auto create stats and auto update of stats. But I want to specify the sampling ratio. What is the easiest way of doing that?

October 22, 2007 5:39 PM
 

Troubleshooting Microsoft SQL Server said:

Auto-Update Statistics For a large majority of SQL Server installations, the most important best practice

August 27, 2008 10:35 AM
 

Easy columns indexing | keyongtech said:

January 18, 2009 11:27 AM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker