Microsoft® SQL Server® 2008 Internals
by Paul Randal Kalen Delaney Kimberly Tripp, and Conor Cunningham
What Is Optimization?
So far, we have discussed only the basic transformation from a logical query tree into an equivalent physical query plan. Another major job of the Query Optimizer is to find an efficient query plan. There are usually many ways to evaluate a given query, and often some plans are much slower than others. The speed difference between these two plans is so significant that selecting the wrong query plan can cause a database application to perform so slowly that it appears broken to the user. Therefore, it is very important that the Query Optimizer select an efficient plan.
At first, it might seem that there would be an “obvious” best plan for every SQL query, and the Query Optimizer should just select it as quickly as it can. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access