December 2013
Intermediate to advanced
1872 pages
153h 31m
English
Similar to the way you use filtered indexes, SQL Server 2012 also lets you create filtered statistics. Like filtered indexes, filtered statistics are also created over a subset of rows in the table based on a specified filter predicate. Creating a filtered index on a column autocreates the corresponding filtered statistics. In addition, filtered statistics can be created explicitly by including the WHERE clause with the CREATE STATISTICS statement.
Filtered statistics can be used to avoid a common issue with statistics where the cardinality estimation is skewed due to a large number of NULL or duplicate values or due to a data correlation between columns. For example, let’s consider a hypothetical table ...