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

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 ...

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