Enumeration of Left-Deep Plans
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 Níth 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.