Database Reference
In-Depth Information
Simplification
Trivial Plan Match
Trivial Plan found?
No
Multiple Optimization Phases
Yes
1 to n Execution Plans
Qualify Parallel Plan?
Yes
Parallel Optimization
No
Save Plan to Procedure Cache
Figure 14-4. Query optimization steps
Simplification
Before the optimizer begins to process your query, the logical engine has already identified all the objects referenced
in your database. When the optimizer begins to construct your execution plan, it first ensures that all objects being
referenced are actually used and necessary to return your data accurately. If you were to write a query with a
three-table join but only two of the tables were actually referenced by either the SELECT criteria or the WHERE clauses,
the optimizer may choose to leave the other table out of the processing. This is known as the simplification step. It's
actually part of a larger set of processing that gathers statistics and starts the process of estimating the cardinality
of the data involved in your query. The optimizer also gathers the necessary information about your constraints,
especially the foreign key constraints, that will help it make decisions about the join order, which it can rearrange as
needed in order to arrive at a good enough plan.
 
 
Search WWH ::




Custom Search