What's a Query Optimizer?

A query optimizer is a process that generates the “optimal” execution path for a query. The optimal execution path is the path that offers the best performance. Before the query is run, the optimizer assigns a cost based on CPU and disk I/O usage for different execution paths. The optimizer then uses the least expensive execution path to process the query. See Figure 19.1 for examples of execution paths.

Figure 19.1. Examples of execution paths.

The advantage of the query optimizer is that it relieves users from the tedious process of having to decide how their SQL statements should be constructed to use indexes and in ...

Get Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.