230 likes | 368 Views
Proactive Re-Optimization. Shivnath Babu, Pedo Bizarro, David DeWitt SIGMOD 2005 (presented by Steve Blundy & Oleg Rekutin). Overview. What’s wrong with reactive? Proactive via 3 core techniques Experiments. Reactive Re-optimization.
E N D
Proactive Re-Optimization Shivnath Babu, Pedo Bizarro, David DeWitt SIGMOD 2005 (presented by Steve Blundy & Oleg Rekutin)
Overview • What’s wrong with reactive? • Proactive via 3 core techniques • Experiments
Reactive Re-optimization selectfrom R, S whereR.a=S.a and R.b>K1and R.c>K2 σ σ(R) actual A: buffer ! σ(R) estimated B: !
Single-Point Limitation A: B:
selectfrom R, S, T whereR.a=S.a and S.b=T.b and R.c>K1and R.d=K2 Limited Information for Re-opt σ(R) act ! ! ! σ(R) est
Choosing a plan • Compute bounding boxes • Use them to generate robust plans and switchable plans • Use randomization to collect statistics
Bounding Boxes • “Representing Uncertainty in Statistics” • Are the upper and lower bounds for each estimated statistic
Optimal Plan • 1 Plan is optimal for all 3 points • Choice is easy
Robust Plan • 1 plan is, or close to, optimal for all 3 points • 1 plan can be safely chosen
Switchable Plan • There is a plan with close to optimal cost plan at each point • Additional Requirements • The decision can be deferred • Actual statistics lie must within bounding box • It is possible to switch between the plans
What is a “Switchable” Plan • “Any two members of a switchable plan are said to be switchable with each other.”
Collecting statistics • Each operator collects some % in buffer • The eos(f) is emitted & statistics are calculated • Plan is chosen from switch plan members or re-optimization is run • Query processing proceeds
Questions • Prevalence of switchable plans vs. case 4 • How good is Rho at preventing re-optimizations • How is Rho affected by large # estimates
Experiments • Traditional Optimizer (TRAD) • Validity-Ranges Optimizer (VRO)
2-Way Join Queries: Robust σ(A) est
2-Way Join Queries: Switchable σ(A) est σ(A) b. box
3-Way Join Example • Shows the use of a Switchable Plan • Some re-optimization still necessary
Conclusion • Rho refines statistics and uses switchable plans to forestall re-optimizations and prevent partial data loss • Questions?