Updating index statistics sql

by  |  11-Oct-2019 11:50

Using the available indexes may not always be the most efficient plan.

For example, if 95% of the values for a column are the same, an index scan will probably be more efficient than using the index on that column.

Once the threshold is reached, SQL Server will automatically update the statistic(s) defined in the table.

updating index statistics sql-14updating index statistics sql-5

There are multiple paths a database can use to answer a query, some of them being faster and more efficient than others.

It is the job of the query optimizer to evaluate and choose the best path, or execution plan, for a given query.

Statistics contain two different types of information about the data; density and distribution.

Density is simply the inverse of the count of distinct values for the column or columns.

Each statistics object contains a histogram displaying the distribution of values of the column (or of the first column in the case of multi-column statistics).

Community Discussion