Query optimization statistics
Query optimization statistics are only a form of dynamic metadata that contains statistical information about the distribution of values in one or more columns of a table or indexed view. Statistics describe index key values, are maintained for index columns, and are used by SQL Server when deciding on the most appropriate indexes to use when running queries. Statistics help estimate the cardinality, or number of rows, in the query result, and this usually helps the query optimizer make better decisions. For example, if there are only a dozen rows in a table, then there is no reason to go to the index to search. This is because it is always better to do a full table scan to find the required result set. However, if ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access