
HistogramĪ histogram measures the frequency of occurrence for each distinct value in a data set. These correlation statistics, or densities, are derived from the number of distinct rows of column values. Statistics objects on multiple columns also store statistical information about the correlation of values among the columns. For example, depending on your predicates, the Query Optimizer could use cardinality estimates to choose the index seek operator instead of the more resource-intensive index scan operator, if doing so improves query performance.Įach statistics object is created on a list of one or more table columns and includes a histogram displaying the distribution of values in the first column.

These cardinality estimates enable the Query Optimizer to create a high-quality query plan. The Query Optimizer uses these statistics to estimate the cardinality, or number of rows, in the query result. Statistics for query optimization are binary large objects (BLOBs) that contain statistical information about the distribution of values in one or more columns of a table or indexed view. This article discusses statistics concepts and provides guidelines for using query optimization statistics effectively. For most queries, the Query Optimizer already generates the necessary statistics for a high-quality query plan in some cases, you need to create additional statistics or modify the query design for best results.


The Query Optimizer uses statistics to create query plans that improve query performance. Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)
