O'Reilly logo

Guru's Guide to SQL Server™ Stored Procedures, XML, and HTML, The by Ken Henderson

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

Query Optimization

When you submit a query to SQL Server, it begins by optimizing your query for execution. Using the statistics and indexes at its disposal, the SQL Server query optimizer develops an execution plan that it believes is the most efficient way to service your query. This optimization is cost-based, with plans that cost less in terms of estimated execution time winning out over those that cost more. The costing process leans heavily toward reducing I/O operations because they are the typical bottleneck when accessing large amounts of data.

As illustrated by Figure 17-1, query plan development consists of several phases or steps:

1.
Identify trivial plans.
2.
Simplify plan.
3.
Load statistics.
4.
Evaluate plans based on cost. ...

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