![]() ![]() These correlation statistics, referred to as densities, are based on the number of distinct rows of column values.Īlthough densities play an important role in query optimization, this article is concerned primarily with distribution statistics as they are accessed through the statistics object. If a statistics object is defined on multiple columns, the object also stores details about the correlation of values across the columns. Each set of statistics is stored as a table-level object that tracks the distribution of values across the first column in any given set. The query optimizer, for the most part, takes care of generating and updating the distribution statistics, creating them on certain columns within a table or indexed view. ![]() Without statics, it would be difficult for the optimizer to determine the best processing strategy in advance. ![]() For example, the statistics might lead the optimizer to choose an index seek over an index scan, a potentially more resource-intensive operation. The statistics provide the optimizer with clues on the best ways to process the query and consequently maximize performance. The statistics provide information about the distribution of column values across participating rows, helping the optimizer better estimate the number of rows, or cardinality, of the query results. The SQL Server query optimizer uses distribution statistics when creating a query plan. SQL Server Statistics Basics - Simple Talk Skip to content ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |