From the course: SQL Server 2016: Administer a Database Infrastructure

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Statistics objects

Statistics objects - SQL Server Tutorial

From the course: SQL Server 2016: Administer a Database Infrastructure

Start my 1-month free trial

Statistics objects

Sequel Server uses statistics about the values found in the column of a table or index view in order to help the query optimizer choose the best execution plan. If those statistics become outdated, then the optimizer can't make the best decisions possible. The statistics are used to estimate how many rows will be returned by a given query, something called Cardinality. If the optimizer thinks that a particular query will return a large number of records, it might choose to perform a table scan, but if it thinks only a few records will be returned, then it might choose to do a seek instead. Choosing the wrong path can lead a query to taking longer than it otherwise would to finish processing. The optimizer has to make the decision on how best to proceed without actually knowing what the data is in the table and it does that by understanding the density and distribution of the data. The density of the data is simply the number of unique values found on the column or set of columns that…

Contents