O'Reilly logo

Microsoft SQL Server 2012 Performance Tuning Cookbook by Bihag Thaker, Ritesh Shah

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Find out-of-date statistics and get it correct

The statistics object is the major source of information about data distribution for the predicate. Without knowing the exact data distribution, the query optimizer cannot have cardinality estimation, which is the process of calculating number of rows to return by applying the predicate.

After creating the statistics for the column, the column becomes out-of-date after executing DML commands, such as INSERT, UPDATE, and DELETE, because these commands change data, thereby affecting data distribution. In this scenario, a statistics update is needed.

In highly active tables, statistics become outdated in maybe a few hours; for static tables, statistics become outdated maybe in a few weeks. The decision ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required