Lab 04 — Join Optimization
Scenario
A regional report joins customers, orders, order items, and payments for recent orders. One-to-many relationships can multiply rows before aggregation and may change both correctness and cost.
Run the exercise
Investigate
- Trace actual rows through every join node.
- Identify nested-loop, hash, or merge joins and explain why each was chosen.
- Compare estimated and actual row multiplication.
- Verify whether joining both items and payments changes the intended count.
- Locate the node responsible for the most work rather than blaming the top aggregate.
Diagnostic question
Is the report slow because of a poor join algorithm, excessive intermediate rows, or both—and is its result semantically correct?