32 CHAPTER 3 Query Optimization and Plan Selection
execution plan would be best. We focus here on the practical tradeoff analysis needed to
find the best query execution plan to illustrate the process.
3.1 Query Processing and Optimization
The basic steps of query processing are:
1. Scanning, parsing, and decomposition of an SQL query. This step checks for correct
SQL query syntax and generates appropriate error messages when necessary. The
output of this step is an intermediate form of the query known as a query tree or
query execution plan.
2. Query optimization. This step includes both local and global optimization. Glo-
bal optimization determines the order of joins and the order of selections and
projections relative to the joins. It also involves ...