Xplus

The need to improve a suboptimal execution plan picked by the query optimizer for a repeatedly run SQL query arises routinely. Complex expressions, skewed or correlated data, and changing conditions can cause the optimizer to make mistakes. For example, the optimizer may pick a poor join order, overlook an important index, use a nested-loop join when a hash join would have done better, or cause an expensive, but avoidable, sort to happen. SQL tuning is also needed while tuning multi-tier services to meet service-level objectives. The difficulty of SQL tuning can be lessened considerably if users and higher-level tuning tools can tell the optimizer: "I am not satisfied with the performance of the plan p being used for the query Q that runs repeatedly. Can you generate a (δ%) better plan?" This paper designs, implements, and evaluates Xplus which, to our knowledge, is the first query optimizer to provide this feature. Xplus goes beyond the traditional plan-first-execute-next approach: Xplus runs some (sub)plans proactively, collects monitoring data from the runs, and iterates. A nontrivial challenge is in choosing a small set of plans to run. Xplus guides this process efficiently using an extensible architecture comprising SQL-tuning experts with different goals, and a policy to arbitrate among the experts. We show the effectiveness of Xplus on real-life tuning scenarios created using TPC-H queries on a PostgreSQL database.

[1]  Guido Moerkotte,et al.  A Blackboard Architecture for Query Optimization in Object Bases , 1993, VLDB.

[2]  Hamid Pirahesh,et al.  Robust query processing through progressive optimization , 2004, SIGMOD '04.

[3]  Peter J. Haas,et al.  Consistent selectivity estimation via maximum entropy , 2007, The VLDB Journal.

[4]  Mohamed Ziauddin,et al.  Query processing and optimization in Oracle Rdb , 1996, The VLDB Journal.

[5]  Joseph M. Hellerstein,et al.  Eddies: continuously adaptive query processing , 2000, SIGMOD '00.

[6]  David J. DeWitt,et al.  The EXODUS optimizer generator , 1987, SIGMOD '87.

[7]  Shivnath Babu,et al.  Tuning Database Configuration Parameters with iTuned , 2009, Proc. VLDB Endow..

[8]  David J. DeWitt,et al.  Proactive re-optimization , 2005, SIGMOD '05.

[9]  Volker Markl,et al.  LEO - DB2's LEarning Optimizer , 2001, VLDB.

[10]  Doron Rotem,et al.  Random sampling from databases: a survey , 1995 .

[11]  Surajit Chaudhuri,et al.  Towards a robust query optimizer: a principled and practical approach , 2005, SIGMOD '05.

[12]  Peter J. Haas,et al.  Discovering and Exploiting Statistical Properties for Query Optimization in Relational Databases: A Survey , 2009, Stat. Anal. Data Min..

[13]  Surajit Chaudhuri,et al.  Power Hints for Query Optimization , 2009, 2009 IEEE 25th International Conference on Data Engineering.

[14]  Surajit Chaudhuri,et al.  A pay-as-you-go framework for query execution feedback , 2008, Proc. VLDB Endow..

[15]  Nick Roussopoulos,et al.  Adaptive selectivity estimation using query feedback , 1994, SIGMOD '94.

[16]  Patrick Valduriez,et al.  User-Optimizer Communication using Abstract Plans in Sybase ASE , 2001, VLDB.

[17]  Benoît Dageville,et al.  Self-Tuning for SQL Performance in Oracle Database 11g , 2009, 2009 IEEE 25th International Conference on Data Engineering.

[18]  Herodotos Herodotou,et al.  Automated SQL tuning through trial and (sometimes) error , 2009, DBTest '09.

[19]  J. S. Saini,et al.  Adaptive Query Processing , 2006 .

[20]  F IlyasIhab,et al.  Discovering and Exploiting Statistical Properties for Query Optimization in Relational Databases: A Survey , 2009 .

[21]  Patricia G. Selinger,et al.  Access path selection in a relational database management system , 1979, SIGMOD '79.