Presentation is loading. Please wait.

Presentation is loading. Please wait.

On-line Index Selection for Physical Database Tuning

Similar presentations


Presentation on theme: "On-line Index Selection for Physical Database Tuning"— Presentation transcript:

1 On-line Index Selection for Physical Database Tuning
Karl Schnaitter UCSC & Aster Data Advisor: Neoklis Polyzotis ISSDM Mentor: John Bent SRL/ISSDM Symposium 2010

2 Index Tuning for Databases
SELECT b FROM R WHERE a = 10 Execution Plan 1 R a b 5 “blue” 10 “red” 97 “green” · · · Reads whole table Discards rows where a ≠ 10 Returns b from remaining rows Table Scan · · · Execution Plan 2 R a b 5 “blue” 10 “red” 97 “green” · · · Only accesses rows where a = 10 May be much faster than a table scan Index Scan index(R(a))

3 Introduction The index selection problem for databases:
The goal is to choose the indexes that improve database performance A crucial part of performance tuning Index selection is very challenging Query benefit must be weighed against the cost of creation, maintenance and storage Dynamic query loads add more difficulty In practice, index selection is typically handled by an experienced database administrator

4 Previous Work Auto-index tuning is an active research topic
Hammer and Chan, SIGMOD 1976 Finkelstein et al., TODS 1988 Chaudhuri and Narasaya, VLDB 1997 Bruno and Chaudhuri, ICDE 2007 …and numerous other references

5 Off-line Index Advisor
Off-line Tuning Tuning Workload User Actual Workload Off-line Index Advisor Recommended Indexes DBA Create/Drop Indexes DBA controls index maintenance DBA must know the workload in advance Limited support for interactive tuning What-if Optimizer Database Server

6 On-line Tuning Tuning is based on actual workload
On-line Index Advisor DBA User Tuning is based on actual workload DBA is out of the loop Performance can become unpredictable What-if Optimizer Create/Drop Indexes Actual Workload Database Server

7 Our Proposal: Semi-automatic Tuning
Feedback Semi-automatic Index Advisor Recommended Indexes User DBA Create/Drop Indexes What-if Optimizer Actual Workload Database Server

8 Semi-automatic Index Advisor
Example Session I like a; I want d I don’t like b Semi-automatic Index Advisor {a, b, c} User DBA {a, d, e, c} {a, f, c} DBA makes decisions on index-maintenance Workload is analyzed online DBA expertise is coupled with index advisor What-if Optimizer Create/Drop Indexes Actual Workload Database Server

9 Our Proposal: Semi-automatic Tuning
Feedback Semi-automatic Index Advisor Recommended Indexes User DBA Create/Drop Indexes What-if Optimizer Actual Workload Database Server

10 Generating Recommendations
workload candidate selection User index candidates Work Function Algorithm (WFA) of Borodin & El Yaniv 1998 + performance guarantees - exponential complexity recommendation logic Work Function Algorithm recommended index set DBA

11 Example of Index Interaction
SELECT b FROM R WHERE a = 10 Execution Plan 1 R a b 5 “blue” 10 “red” 97 “green” · · · Only accesses rows where a = 10 May be much faster than a table scan Index Scan index(R(a)) Execution Plan 2 ++ Example of index interaction Only accesses index If plan 2 is cheaper, the index on R.a becomes obsolete Index-Only Scan index(R(a,b))

12 Interaction-Based Partitioning
Consider an undirected graph Vertex for each candidate index Edge between interacting indexes ++ Describe stable partitioning We call this a stable partition of the indexes Different components have independent benefits

13 Improvement: Candidate Partitioning
workload candidate selection partitioned index candidates User recommendation logic Need to handle feedback WFA WFA WFA recommended index set DBA

14 Feedback Model User provides votes for some indexes
Positive votes for indexes they want Negative votes for indexes they don’t want Votes may be explicit E.g., user may reject the system’s recommendation to create an index Votes may also be implicit Creating an index casts a positive vote Dropping an index casts a negative vote ++ What is the interface for feedback

15 Handling Feedback Votes create a soft constraint on future recommendations Include indexes with positive votes Exclude indexes with negative votes Reverse these decisions if sufficient evidence is seen after the votes were cast ++ High-level description of how feedback is taken into account

16 partitioned index candidates
Final Solution: WFIT workload candidate selection partitioned index candidates User recommendation logic feedback WFA WFA WFA recommended index set DBA

17 Behavior of WFIT with Feedback
“Good” votes follow the best indexes chosen off-line “Bad” votes are opposite of “Good” votes Normalized against optimal schedule ++ Example of empirical results

18 Conclusions Semi-automatic tuning is a promising new approach to physical database design Combines best features of existing approaches User feedback is the key ingredient We recommend indexes with provable performance guarantees Using work function algorithm as the foundation Future work may include: More efficient workload analysis A GUI frontend to present recommendations


Download ppt "On-line Index Selection for Physical Database Tuning"

Similar presentations


Ads by Google