Adaptively Reordering Joins during Query Execution

Traditional query processing techniques based on static query optimization are ineffective in applications where statistics about the data are unavailable at the start of query execution or where the data characteristics are skewed and change dynamically. Several adaptive query processing techniques have been proposed in recent years to overcome the limitations of static query optimizers through either explicit re-optimization of plans during execution or by using a row-routing based approach. In this paper, we present a novel method for processing pipelined join plans that dynamically arranges the join order of both inner and outer-most tables at run-time. We extend the Eddies concept of "moments of symmetry" to reorder indexed nested-loop joins, the join method used by all commercial DBMSs for building pipelined query plans for applications for which low latencies are crucial. Unlike row-routing techniques, our approach achieves adaptability by changing the pipeline itself which avoids the bookkeeping and routing decision associated with each row. Operator selectivities monitored during query execution are used to change the execution plan at strategic points, and the change of execution plans utilizes a novel and efficient technique for avoiding duplicates in the query results. Our prototype implementation in a commercial DBMS shows a query execution speedup of up to 8 times.

[1]  Jennifer Widom,et al.  Flexible time management in data stream systems , 2004, PODS.

[2]  Jennifer Widom,et al.  Adaptive caching for continuous queries , 2005, 21st International Conference on Data Engineering (ICDE'05).

[3]  Toshihide Ibaraki,et al.  On the optimal nesting order for computing N-relational joins , 1984, TODS.

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

[5]  Stavros Christodoulakis,et al.  On the propagation of errors in the size of join results , 1991, SIGMOD '91.

[6]  Carlo Zaniolo,et al.  Optimization of Nonrecursive Queries , 1986, VLDB.

[7]  Patricia G. Selinger,et al.  System R: An Architectural Overview , 1999, IBM Syst. J..

[8]  Joseph M. Hellerstein,et al.  Lifting the Burden of History from Adaptive Query Processing , 2004, VLDB.

[9]  Laurent Amsaleg,et al.  Scrambling query plans to cope with unexpected delays , 1996, Fourth International Conference on Parallel and Distributed Information Systems.

[10]  S. Ramey,et al.  Acknowledgement , 2000, NeuroImage.

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

[12]  Samuel Madden,et al.  Continuously adaptive continuous queries over streams , 2002, SIGMOD '02.

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

[14]  Surajit Chaudhuri,et al.  Optimization of queries with user-defined predicates , 1996, TODS.

[15]  Shivnath Babu,et al.  Adaptive Query Processing in the Looking Glass , 2005, CIDR.

[16]  Clyde L. Monma,et al.  Sequencing with Series-Parallel Precedence Constraints , 1979, Math. Oper. Res..

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

[18]  Elke A. Rundensteiner,et al.  Dynamic plan migration for continuous queries over data streams , 2004, SIGMOD '04.

[19]  Jennifer Widom,et al.  Adaptive ordering of pipelined stream filters , 2004, SIGMOD '04.

[20]  Stavros Christodoulakis,et al.  Implications of certain assumptions in database performance evauation , 1984, TODS.

[21]  David J. DeWitt,et al.  Efficient mid-query re-optimization of sub-optimal query execution plans , 1998, SIGMOD '98.

[22]  Alon Y. Halevy,et al.  Adapting to source properties in processing data integration queries , 2004, SIGMOD '04.

[23]  Goetz Graefe,et al.  Optimization of dynamic query evaluation plans , 1994, SIGMOD '94.

[24]  Irving L. Traiger,et al.  System R: An Architectural Overview , 1999, IBM Syst. J..

[25]  Joseph M. Hellerstein,et al.  Optimization techniques for queries with expensive methods , 1998, TODS.

[26]  Laurent Amsaleg,et al.  Cost-based query scrambling for initial delays , 1998, SIGMOD '98.

[27]  Joseph M. Hellerstein,et al.  Using state modules for adaptive query processing , 2003, Proceedings 19th International Conference on Data Engineering (Cat. No.03CH37405).

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

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

[30]  Amol Deshpande,et al.  An initial study of overheads of eddies , 2004, SGMD.

[31]  Sylvain Lecomte,et al.  Adaptive query processing in mobile environment , 2005, MPAC '05.

[32]  Karen Ward,et al.  Dynamic query evaluation plans , 1989, SIGMOD '89.