Published on

November 27, 2010

Understanding Statistics in SQL Server

Statistics play a crucial role in the performance of SQL Server. They provide valuable information to the query optimizer, helping it choose the most efficient plan for retrieving or updating data. In this article, we will explore the importance of statistics and how they are used in Microsoft SQL Server.

Microsoft has published a white paper titled “Statistics Used by the Query Optimizer in Microsoft SQL Server 2008” that provides in-depth information on this topic. The paper, written by Eric N. Hanson and Yavor Angelov, explains what data is collected, where it is stored, and which commands create, update, and delete statistics.

By default, SQL Server 2008 automatically creates and updates statistics when it deems it necessary. This ensures that the query optimizer has the most up-to-date information to make informed decisions. However, it is also possible to change these defaults at different levels, such as the column, table, or database.

The white paper also discusses how certain query language features, like Transact-SQL variables, interact with the use of statistics by the optimizer. It provides guidance on how to write queries that leverage these features to achieve optimal query performance.

If you are interested in delving deeper into the subject of statistics in SQL Server, I highly recommend reading the white paper. It offers a comprehensive understanding of how statistics are utilized by the query optimizer and provides valuable insights for optimizing your SQL Server environment.

Remember, statistics are the heart of SQL Server. By understanding how they work and leveraging them effectively, you can significantly improve the performance of your database queries.

Link to the white paper: Statistics Used by the Query Optimizer in Microsoft SQL Server 2008

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.