230 likes | 247 Vues
CoPhy : A Scalable, Portable, and Interactive Index Advisor for Large Workloads. Debabrata Dash, Anastasia Ailamaki, Neoklis Polyzotis. High Cost of DB Tuning. Sources: MS Azure, Forrester Research; 2010. oracle.com/us/products/database/039433.pdf.
E N D
CoPhy: A Scalable, Portable, and Interactive Index Advisorfor Large Workloads Debabrata Dash, Anastasia Ailamaki, NeoklisPolyzotis
High Cost of DB Tuning Sources: MS Azure, Forrester Research; 2010 oracle.com/us/products/database/039433.pdf Need to reduce administration and tuning cost Enterprises spend a lot on DBMS
A New Approach to Index Tuning Index Tuning: Select indexes that maximize performance • CoPhy: Convert to a compact Binary Integer Program (BIP). Solve using mature solvers. • BIP:
Outline • Introduction • BIP formulation • Existing formulation • Discovering structure • Exploiting the structure • Benefits • Experimental Results • Conclusion
Index Tuning Problem T1 Join T2 Workload Candidates I1 I2 I3 I4 T1 T2 Index Tuning Constraints Optimal Indexes ? ?
Existing Approaches What-If DBMS Optimizer What-If DBMS Optimizer Index Advisor Index Advisor Fast What-If Optimizer [INUM07,C-PQO08] • Greedy approaches • Bottom-up [CN97, VZ+00] • Top-down [BC05] • BIP-based approach [CS96, PA07]
Existing BIP are atomic configurations are corresponding costs t1 t2 {0,1} I1 I2 I3 I4 T1 T2 x1x2 x3 x4 Min. Cost {0,1} Select one atomic conf. Index presence Program size = O(# T1 Indexes x # T2 Indexes)
CoPhy vs. Existing Approaches What-If DBMS Optimizer Index Advisor Fast What-If Optimizer [INUM07,C-PQO08] CoPhy What-If DBMS Optimizer Fast What-If Optimizer Index Advisor
Fast What-If: INUM What-If Optimizer Plan T1 Join T2 Template Plan Place Holder Place Holder I4 I1 I1 I3 I3 I1 I4 I1 Instantiated Plan Instantiated Plan A template plan can be reused for many index combinations
Cost Structure Cost of template plan under A Atomic Configuration Cost of optimal plan under A LinearComposability is exhibited by both INUM, C-PQO Linear Composability of Query Costs
Exploiting Linear Composability t1 t2 I1 I2 I3 I4 T1 T2 x1x2 x3 x4 Program size = O(# T1 Indexes + # T2 Indexes) BIP Solver explores the index combinations with the knowledge of the objective Exposing the cost model leads to linearly growing BIPs
More Complex BIPs We extend the BIP to handle: BIP formulation does not restrict the expressive power of the DBA • Complex queries • Update costs • Complex Constraints [Bruno08]: • Storage constraint • Index constraints • Column constraints • Generators • Soft constraints
CoPhy’s Architecture Workload What-If DBMS Optimizer Candidate Generator INUM BIP Generator Constraints BIP Solver CoPhy Selected Indexes Bounds Theorem: CoPhy computes an optimal index configuration
Unique Features Enabled by the BIP • Portability: No change to the optimizer • Requires only the what-if APIs • Scalability: By solving large BIPs in seconds • No need to select workload, candidate indexes • Generality: The formulation can be reused • Quality feedback: All modern BIP solvers provide this • Can stop at near-optimal values • Interactive tuning: By solving BIPs incrementally • Interactively add/drop candidate indexes • Enables efficient multi-objective optimization
Outline • Introduction • BIP formulation • Existing formulation • Discovering structure • Exploiting the structure • Benefits • Experimental Results • Conclusion
Experimental Setup • Two commercial DBMS -- SystemA, SystemB • 1 GB TPC-H database • 1 GB index size constraint • Algorithms: • ToolA, ToolB – the commercial designers • ILP – The state of the art BIP [PA07] • CoPhyA, CoPhyB – Our approach on the systems • Queries generated using 15 TPC-H templates • Metric:
Speedup Comparison Better # of queries SystemA # of queries SystemB # Candidates: CoPhy ~2000, ToolA ~200, ToolB ~50 • Replacing heuristic algorithms improves savings • Using larger set of candidates also helps
Tool Execution Time Comparison Better # of queries SystemA # of queries SystemA # of queries SystemB Scalable index tuning eliminates the workload selection problem
Conclusion • Index tuning using a novel compact BIP • Generic, scalable, efficient, and high quality • Quality feedback • Incremental index selection • Multi-objective optimization • Future Work: • Incorporating other workload types • Applying the approach to other tuning problems
BIP for Multiple Plans Matching logic I1 I2 I3 I4 25 One plan per query 15 Minimize cost T1 T2 x23x24 x25x26
More Complex BIPs Build indexes when used Size under a fixed constant Storage constraint
CoPhy vs. FLP Better Offloading the search process to the solver improves both the problem construction and solving times