By Jonathan Gennick

SQL Server’s query optimization process is responsible for producing a query execution plan when a SELECT query is executed. Typically SQL Server will choose an efficient plan over an inefficient one. When this doesn’t happen, you will want to examine the query execution plan, table statistics, supporting indexes, and other factors that are discussed in more detail in Chapters 21 and 23. Ultimately, after researching the query’s performance, you may decide to override the decision-making process of the SQL Server query optimizer by using hints.

 Caution  You should almost always let SQL Server’s query optimization ...

Get SQL Server 2012 T-SQL Recipes: A Problem-Solution Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.