



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!




10/6/08 1
10/6/08 2
10/6/08 3
10/6/08 4
Often many different plans that produce the same result!! 10/6/08 5
10/6/08 6
10/6/08 10
10/6/08 11
10/6/08 12
Came about after System R
10/6/08 13 Step 2: Single-Table Cost Estimation For each relation, calculate the cost of scanning the relation using each suitable index and table scan Cost = #I/Os + W * RSI Calls
Example: SELECT * FROM Employees WHERE Name = ‘Bob’ AND Salary = 50000 Assume: Clustered index on Name Unclustered index on Salary
10/6/08 14 Step 3: Join Method and Ordering System R: Only consider left-deep join trees Used to restrict the search space Left-deep plans can be fully pipelined. Intermediate results not written to temporary files. Not all left-deep trees are fully pipelined (e.g., SM join). A^ B C D A B C D A B C D outer (^) inner
10/6/08 15 Enumeration of Left-Deep Plans
Join order Join method for each join
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.)
Cheapest plan overall, plus Cheapest plan for each interesting order of the tuples.