Join optimization and dynamic programming
Greedy approach
- Find the cheapest 1-table plan.
- Starting with that 1-table plan, find the cheapest 2-table plan
(considering all joins and join algorithms).
- Keep going until we have an n-table plan.
- Each iteration begins with one plan, considers next
moves, and then picks the best of these.
Don't do this — we can do better.
|