Title: Proactive Re-Optimization
1Proactive Re-Optimization
- Shivnath Babu, Pedo Bizarro, David DeWitt
- SIGMOD 2005
- (presented by Steve Blundy Oleg Rekutin)
2Overview
- Whats wrong with reactive?
- Proactive via 3 core techniques
- Experiments
3Reactive Re-optimization
- select from R, S where R.aS.a and R.bgtK1 and
R.cgtK2
s
s(R) actual
A
buffer
!
s(R) estimated
B
!
4Single-Point Limitation
A
B
5Limited Information for Re-opt
- select from R, S, T where R.aS.a and S.bT.b
and R.cgtK1 and R.dK2
s(R) act
!
!
!
s(R) est
6Choosing a plan
- Compute bounding boxes
- Use them to generate robust plans and switchable
plans - Use randomization to collect statistics
7Bounding Boxes
- Representing Uncertainty in Statistics
- Are the upper and lower bounds for each estimated
statistic
8Bounding Boxes
9Optimal Plan
- 1 Plan is optimal for all 3 points
- Choice is easy
10Robust Plan
- 1 plan is, or close to, optimal for all 3 points
- 1 plan can be safely chosen
11Switchable 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
12What is a Switchable Plan
- Any two members of a switchable plan are said to
be switchable with each other.
13Collecting 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
14Questions
- Prevalence of switchable plans vs. case 4
- How good is Rho at preventing re-optimizations
- How is Rho affected by large estimates
15Experiments
- Traditional Optimizer (TRAD)
- Validity-Ranges Optimizer (VRO)
162-Way Join Queries Robust
s(A) est
172-Way Join Queries Switchable
s(A) est
s(A) b. box
183-Way Join Example
- Shows the use of a Switchable Plan
- Some re-optimization still necessary
19Pt s1(A) TRAD VRO Rio Opt
A 6 MB P17a Inside range, P17a Outside box, re-optimize, P17a P17a
B 80 MB P17a Inside range, P17a Inside box, P17a P17a
C 160 MB P17a Outside range, re-optimize, P17d Inside box, P17d P17b
D 310 MB P17a Outside range, re-optimize, P17d Outside box, re-optimize, P17b P17b
20(No Transcript)
21Correlation-Based Mistakes
22Query Complexity
23Conclusion
- Rho refines statistics and uses switchable plans
to forestall re-optimizations and prevent partial
data loss - Questions?