Enumeration of Left-Deep Plans
Left-deep plans differ only in the order of relations, the access method for each relation, and the join method for each join.
Enumerated using N passes (if N relations joined):
- Pass 1: Find best 1-relation plan for each relation.
- Pass 2: Find best way to join result of each 1-relation plan (as outer) to another relation. (All 2-relation plans.)
- Pass N: Find best way to join result of a (N-1)-relation plan (as outer) to the Nth relation. (All N-relation plans.)
For each subset of relations, retain only:
- Cheapest plan overall, plus
- Cheapest plan for each interesting order of the tuples.