Optimizing object queries using an effective calculus

Object-oriented databases (OODBs) provide powerful data abstractions and modeling facilities, but they generally lack a suitable framework for query processing and optimization. The development of an effective query optimizer is one of the key factors for OODB systems to successfully compete with relational systems, as well as to meet the performance requirements of many nontraditional applications. We propose an effective framework with a solid theoretical basis for optimizing OODB query languages. Our calculus, called the monoid comprehension calculus, captures most features of ODMG OQL, and is a good basis for expressing various optimization algorithms concisely. This article concentrates on query unnesting (also known as query decorrelation), an optimization that, even though it improves performance considerably, is not treated properly (if at all) by most OODB systems. Our framework generalizes many unnesting techniques proposed recently in the literature, and is capable of removing any form of query nesting using a very simple and efficient algorithm. The simplicity of our method is due to the use of the monoid comprehension calculus as an intermediate form for OODB queries. The monoid comprehension calculus treats operations over multiple collection types, aggregates, and quantifiers in a similar way, resulting in a uniform method of unnesting queries, regardless of their type of nesting.

[1]  Dan Suciu,et al.  Comprehension syntax , 1994, SGMD.

[2]  David J. DeWitt,et al.  Of Objects and Databases: A Decade of Turmoil , 1996, VLDB.

[3]  David Maier,et al.  Towards an effective calculus for object query languages , 1995, SIGMOD '95.

[4]  Won Kim,et al.  On optimizing an SQL-like nested query , 1982, TODS.

[5]  Limsoon Wong,et al.  Normal forms and conservative properties for query languages over collection types , 1993, PODS.

[6]  Peter M. G. Apers,et al.  Optimization of Nested Queries in a Complex Object Model , 1994, EDBT.

[7]  Guido Moerkotte,et al.  Optimizing Queries with Universal Quantification in Object-Oriented and Object-Relational Databases , 1997, VLDB.

[8]  Stephen A. Cook,et al.  A new recursion-theoretic characterization of the polytime functions (extended abstract) , 1992, STOC '92.

[9]  Simon Peyton Jones,et al.  The Implementation of Functional Programming Languages (Prentice-hall International Series in Computer Science) , 1987 .

[10]  Stanley B. Zdonik,et al.  The AQUA Data Model and Algebra , 1993, DBPL.

[11]  Limsoon Wong,et al.  Querying Nested Collections , 1994 .

[12]  Daniel Leivant,et al.  Stratified functional programs and computational complexity , 1993, POPL '93.

[13]  Peter Buneman,et al.  Structural Recursion as a Query Language , 1992, DBPL.

[14]  Guido Moerkotte,et al.  Eecient Evaluation of Aggregates on Bulk Types , 1995 .

[15]  Limsoon Wong,et al.  Principles of Programming with Complex Objects and Collection Types , 1995, Theor. Comput. Sci..

[16]  Philip Wadler,et al.  Comprehending monads , 1990, Mathematical Structures in Computer Science.

[17]  Patrick Valduriez,et al.  A FAD for Data Intensive Applications , 1992, IEEE Trans. Knowl. Data Eng..

[18]  Stanley B. Zdonik,et al.  Changing the rules: transformations for rule-based optimizers , 1998, SIGMOD '98.

[19]  Latha S. Colby A recursive algebra and query optimization for nested relations , 1989, SIGMOD '89.

[20]  Sophie Cluet,et al.  A general framework for the optimization of object-oriented queries , 1992, SIGMOD '92.

[21]  Maarten M. Fokkinga,et al.  Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire , 1991, FPCA.

[22]  Limsoon Wong,et al.  A query language for multidimensional arrays: design, implementation, and optimization techniques , 1996, SIGMOD '96.

[23]  Limsoon Wong,et al.  Naturally Embedded Query Languages , 1992, ICDT.

[24]  Donald D. Chamberlin,et al.  Access Path Selection in a Relational Database Management System , 1989 .

[25]  Leonidas Fegaras,et al.  VOODOO: A Visual Object-Oriented Database Language for ODMG OQL , 1999, ECOOP Workshops.

[26]  David J. DeWitt,et al.  Shoring up persistent applications , 1994, SIGMOD '94.

[27]  David Maier,et al.  Specifying Rule-Based Query Optimizers in a Reflective Framework , 1993, DOOD.

[28]  Benjamin C. Pierce,et al.  Basic category theory for computer scientists , 1991, Foundations of computing.

[29]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[30]  O. Deux,et al.  The Story of O2 , 1990, IEEE Trans. Knowl. Data Eng..

[31]  Philip Wadler,et al.  Improving list comprehension database queries , 1989, Fourth IEEE Region 10 International Conference TENCON.

[32]  Simon Thompson,et al.  Haskell: The Craft of Functional Programming , 1996 .

[33]  P Pistor,et al.  A database language for sets, lists and tables , 1986, Inf. Syst..

[34]  Philip W. Trinder,et al.  Object Comprehensions: A Query Notation for Object-Oriented Databases , 1994, BNCOD.

[35]  Val Tannen,et al.  Logical and Computational Aspects of Programming with Sets/Bags/Lists , 1991, ICALP.

[36]  Philip W. Trinder,et al.  Comprehensions, a Query Notation for DBPLs , 1992, DBPL.

[37]  Leonidas Fegaras,et al.  Query unnesting in object-oriented databases , 1998, SIGMOD '98.

[38]  David Maier,et al.  λ-DB: an ODMG-based object-oriented DBMS , 2000, SIGMOD '00.

[39]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[40]  Hamid Pirahesh,et al.  Magic is relevant , 1990, SIGMOD '90.

[41]  François Bancilhon,et al.  Building an Object-Oriented Database System, The Story of O2 , 1992 .

[42]  Alon Y. Halevy,et al.  Query Optimization by Predicate Move-Around , 1994, VLDB.

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

[44]  Guido Moerkotte,et al.  Nested Queries in Object Bases , 1993, DBPL.

[45]  Guido Moerkotte,et al.  Advanced Query Processing in Object Bases Using Access Support Relations , 1990, VLDB.

[46]  David Beech Collections of Objects in SQL3 , 1993, VLDB.

[47]  Guido Moerkotte,et al.  Efficient Evaluation of Aggregates on Bulk Types , 1995, DBPL.

[48]  David Maier,et al.  lambda-DB: An ODMG-Based Object-Oriented DBMS , 2000, SIGMOD Conference.

[49]  Jim Melton,et al.  SQL: 1999, formerly known as SQL3 , 1999, SGMD.

[50]  Leonidas Fegaras Efficient Optimization of Iterative Queries , 1993, DBPL.

[51]  Z. Meral Özsoyoglu,et al.  Processing OODB queries by O-Algebra , 1996, CIKM '96.

[52]  Harry K. T. Wong,et al.  Optimization of nested SQL queries revisited , 1987, SIGMOD '87.

[53]  M. Muralikrishna,et al.  Improved Unnesting Algorithms for Join Aggregate SQL Queries , 1992, VLDB.

[54]  Stanley B. Zdonik,et al.  Inferring Function Semantics to Optimize Queries , 1998, VLDB.

[55]  David Maier,et al.  A call to order , 1993, PODS '93.

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

[57]  Catriel Beeri,et al.  Algebraic Optimization of Object-Oriented Query Languages , 1990, Theor. Comput. Sci..