Problem solve Get help with specific problems with your technologies, process and projects.

Manually updating statistics to improve query performance

A quick tip about manually updating statistics to improve query performance.

Do you have a large number of rows being added to or deleted from a table (during the day or as a part of a night job)? Do your users report that their initial queries are very slow but then response time improves for subsequent queries?

If so, you can handle this situation by improving the response time for the initial queries by not only relying on the assumption that the auto update statistics database option is set to TRUE. You should also manually update the statistics (on indexes) by using the sp_updatestats stored procedure.

Do not rely on the auto update stats option as this may not take effect immediately, thereby degrading performance.

  • What do you think about this tip? E-mail the Editor at with your feedback.
  • The Best SQL Server Web Links: tips, tutorials, scripts, and more.
  • Have an SQL Server tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
  • Ask your technical SQL Server questions--or help out your peers by answering them--in our live discussion forums.
  • Check out our Ask the Experts feature: Our SQL, Database Design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.

Dig Deeper on SQL Server and .NET development

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.