


































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



































Heuristics for pruning plan space
Physical Plan Selection
Logical Query Plan
P1 P2 …. Pn
C1 C2 …. Cn
Pick minimum cost one
Physical plans
Costs
Note: The simple cost model used for illustration only
Query: (^) R1 R2 R3 R4 R
Optimal Plan:
Query: (^) R1 R2 R3 R4 R
Optimal Plan:
Optimal plan for joining R3, R2, R
Query: (^) R1 R2 … Rn
Optimal for joining R1, R2, R
Sub-Optimal for joining R1, R2, R
Query: (^) R1 R2 R3 R
{ R1 } { R2 } { R3 } { R4 }
{ R1, R2 } { R1, R3 } { R1, R4 } { R2, R3 } { R2, R4 } { R3, R4 }
{ R1, R2, R3 } { R1, R2, R4 } { R1, R3, R4 } { R2, R3, R4 }
{ R1, R2, R3, R4 }
Progress of algorithm
Selinger Algorithm:
Query: (^) R1 R2 R3 R
{ R1 } { R2 } { R3 } { R4 }
{ R1, R2 } { R1, R3 } { R1, R4 } { R2, R3 } { R2, R4 } { R3, R4 }
{ R1, R2, R3 } { R1, R2, R4 } { R1, R3, R4 } { R2, R3, R4 }
{ R1, R2, R3, R4 }
Progress of algorithm
Selinger Algorithm:
Query: (^) R1 R2 R3 R
{ R1 } { R2 } { R3 } { R4 }
{ R1, R2 } { R1, R3 } { R1, R4 } { R2, R3 } { R2, R4 } { R3, R4 }
{ R1, R2, R3 } { R1, R2, R4 } { R1, R3, R4 } { R2, R3, R4 }
{ R1, R2, R3, R4 }
Progress of algorithm
Selinger Algorithm: