Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cs4432optimization1 CS4432: Database Systems II Lecture #18 Query Optimizer – Wrap Up Professor Elke A. Rundensteiner.

Similar presentations


Presentation on theme: "Cs4432optimization1 CS4432: Database Systems II Lecture #18 Query Optimizer – Wrap Up Professor Elke A. Rundensteiner."— Presentation transcript:

1 cs4432optimization1 CS4432: Database Systems II Lecture #18 Query Optimizer – Wrap Up Professor Elke A. Rundensteiner

2 cs4432optimization2 Operator Types Stateful versus stateless operators –Select is stateless –Join is stateful Blocking versus non-blocking operators –Select is non-blocking –Agg functions are blocking Pipelined versus non-pipelined operators –Select is pipelinable –What about Join ? (see next slide)

3 cs4432optimization3 Join? Join : Revelation is that it depends on the implementation strategy chosen for an operator –Iteration-join : pipelinable –Merge-sort join : blocking –Index join : pipelinable –Hash join : blocking

4 cs4432optimization4 Costing of a complete plan We went over an example query plan Important: first we classify operators as pipelined or not-pipelined If pipelined, then for stateless operators the IO cost is zero (for example, for Select or Project)

5 cs4432optimization5 Costing of a Complete Query Plan What about a Select? How is it implemented? If in middle of plan, pipeline it (one tuple at a time iteration) If at leaf of plan, identify any potential index to use index-lookup to implement the Select If index available, cost of implemention the select operator is equal to cost of an index lookup

6 cs4432optimization6 Costing of a complete plan Main idea: –Determine # of distinct values – V(R,a) –Determine physical impl. Strategies per operator –Then, compute IO costs for each operator –Then, sum up all costs. –Done.

7 cs4432optimization7 Many alternate search algorithms are possible: 1.Exhaustive listing of all possible plans 2.Dynamic programming 3.Branch and bound 4.Greedy bottom-up plan construction NOTE: often only left-deep trees are being considered to keep the search space small. How to generate that ‘good’ Physical Plan?


Download ppt "Cs4432optimization1 CS4432: Database Systems II Lecture #18 Query Optimizer – Wrap Up Professor Elke A. Rundensteiner."

Similar presentations


Ads by Google