Executing Nested Queries

Optimization of nested queries, in particular finding equivalent “flattened” queries for queries that employ the SQL sub-query construct, has been researched extensively. In contrast, with the exception of nested loops join, execution of nested plans has found little interest. Nested execution plans may result from a failure to flatten nested SQL expressions but just as likely are created by a query optimizer to exploit all available indexes as effectively as possible. In fact, if materialized views and index tuning perform as expected, few queries should require large operations such as parallel scans, sorts and hash joins, and most actual query plans will rely entirely on navigating indexes on tables and views. Note that only index navigation plans scale truly gracefully, i.e., perform equally well on large and on very large databases, whereas sorting and hashing scale at best linearly. Since a typical index navigation plan employs nested iteration, this paper describes techniques to execute such plans efficiently as well as means to cleanly implement these techniques. Taken together, these techniques can improve query performance by orders of magnitude, giving them obvious practical importance.

[1]  David J. DeWitt,et al.  Computing sql queries one webpage at a time , 2001 .

[2]  Rudolf Bayer,et al.  The Universal B-Tree for Multidimensional Indexing: general Concepts , 1997, WWCA.

[3]  Philip A. Bernstein,et al.  Using Semi-Joins to Solve Relational Queries , 1981, JACM.

[4]  Takashi Masuda,et al.  Worldwide Computing and Its Applications , 1997, Lecture Notes in Computer Science.

[5]  Robert Kooi,et al.  Query Optimization in INGRES. , 1982 .

[6]  Goetz Graefe,et al.  Experiences building the open OODB query optimizer , 1993, SIGMOD Conference.

[7]  Hamid Pirahesh,et al.  Cost-based optimization for magic: algebra and implementation , 1996, SIGMOD '96.

[8]  Rohit Jain,et al.  Efficient Search of Multidimensional B-Trees , 1998 .

[9]  李幼升,et al.  Ph , 1989 .

[10]  Guy M. Lohman,et al.  Query Optimization in the IBM DB2 Family. , 1993 .

[11]  Won Kim,et al.  A new way to compute the product and join of relations , 1980, SIGMOD '80.

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

[13]  C. Mohan,et al.  Single Table Access Using Multiple Indexes: Optimization, Execution, and Concurrency Control Techniques , 1990, EDBT.

[14]  Rohit Jain,et al.  Efficient Search of Multi-Dimensional B-Trees , 1995, VLDB.

[15]  David Maier,et al.  Efficient Assembly of Complex Objects ; CU-CS-502-90 , 1990 .

[16]  Volker Markl,et al.  Integrating the UB-Tree into a Database System Kernel , 2000, VLDB.

[17]  Goetz Graefe Iterators, Schedulers, and Distributed-memory Parallelism , 1996, Softw. Pract. Exp..

[18]  Jian Wang,et al.  A keying method for a nested relational database management system , 1992, [1992] Eighth International Conference on Data Engineering.

[19]  David J. DeWitt,et al.  Nested loops revisited , 1993, [1993] Proceedings of the Second International Conference on Parallel and Distributed Information Systems.

[20]  Robert Kooi,et al.  The Optimization of Queries in Relational Databases , 1980 .

[21]  Goetz Graefe,et al.  Query evaluation techniques for large databases , 1993, CSUR.

[22]  Christos Faloutsos,et al.  Analysis of the Clustering Properties of the Hilbert Space-Filling Curve , 2001, IEEE Trans. Knowl. Data Eng..

[23]  Laura M. Haas,et al.  Seeking the truth about ad hoc join costs , 1997, The VLDB Journal.

[24]  Theo Härder Implementing a generalized access path structure for a relational database system , 1978, TODS.

[25]  Goetz Graefe,et al.  Hash Joins and Hash Teams in Microsoft SQL Server , 1998, VLDB.

[26]  Jeffrey F. Naughton,et al.  Query execution techniques for caching expensive methods , 1996, SIGMOD '96.

[27]  Gerhard Weikum,et al.  The LRU-K page replacement algorithm for database disk buffering , 1993, SIGMOD Conference.

[28]  Michael Stonebraker,et al.  Operating system support for database management , 1981, CACM.