Chapter 12. Statistics in SQL Server

In this chapter we will cover:

  • Creating and updating statistics
  • Effects of statistics on non-key columns
  • Finding out-of-date statistics and correct them
  • Effects of statistics on a filtered index

Introduction

Query Statistics:

By now, we have already learnt about the index in Chapter 9, Implementing Indexes, and Chapter 10, Maintaining Indexes. The optimizer chooses the index for a query if there are proper and updated statistics available for key columns of the index, because the SQL Server optimizer is a cost-based optimizer. An optimizer can decide the best way to execute the query, based on the data going to be displayed in result sets with the help of column(s) used in the WHERE and ON clauses. The optimizer ...

Get Microsoft SQL Server 2012 Performance Tuning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.