Alternative Plans 1
Main difference: push selects.
With 5 buffers, cost of plan:
- Scan Reserves (1000) + write temp T1
(10 pages, if we have 100 boats, uniform distribution).
- Scan Sailors (500) + write temp T2 (250 pages, if we have 10 ratings).
- Sort T1 (2*2*10), sort T2 (2*3*250), merge (10+250), total=1800
- Total: 3560 page I/Os.
If we used BNL join, join cost = 10+4*250, total cost = 2770.
If we ‘push’ projections, T1 has only sid, T2 only sid and sname:
- T1 fits in 3 pages, cost of BNL drops to under 250 pages, total < 2000.