Microsoft® SQL Server 2012 Unleashed
by Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein
Summary
The SQL Server Query Optimizer has improved over the years, taking advantage of new techniques and algorithms to improve its capability to find the most efficient execution plan. Understanding how queries are optimized and what information the Query Optimizer uses to generate and select an execution plan will help you write more efficient queries and choose better indexes. To help the Query Optimizer, you should at least try to write queries that can be optimized effectively by avoiding the common query optimization problems discussed in this chapter.
Most of the time, the Query Optimizer chooses the most efficient query plan. When it doesn’t, the reason might be problems with the way the query itself is written, out-of-date or unavailable ...