Optimizing multi-table queries
Overview
To optimize a query block that joins n tables:
Two-table query optimization
- Extend each 1-table plan to a 2-table plan by joining one
more table. (Heuristic: Don't consider cartesian products.)
- Push selects and projects below the new table being joined.
- Consider each join algorithm for joining in the new table.
- Find the best plan for each pair of tables.
|