skip to main content
10.1145/170035.170078acmconferencesArticle/Chapter ViewAbstractPublication PagesmodConference Proceedingsconference-collections
Article
Free Access

Predicate migration: optimizing queries with expensive predicates

Authors Info & Claims
Published:01 June 1993Publication History

ABSTRACT

The traditional focus of relational query optimization schemes has been on the choice of join methods and join orders. Restrictions have typically been handled in query optimizers by “predicate pushdown” rules, which apply restrictions in some random order before as many joins as possible. These rules work under the assumption that restriction is essentially a zero-time operation. However, today's extensible and object-oriented database systems allow users to define time-consuming functions, which may be used in a query's restriction and join predicates. Furthermore, SQL has long supported subquery predicates, which may be arbitrarily time-consuming to check. Thus restrictions should not be considered zero-time operations, and the model of query optimization must be enhanced.

In this paper we develop a theory for moving expensive predicates in a query plan so that the total cost of the plan — including the costs of both joins and restrictions — is minimal. We present an algorithm to implement the theory, as well as results of our implementation in POSTGRES. Our experience with the newly enhanced POSTGRES query optimizer demonstrates that correctly optimizing queries with expensive predicates often produces plans that are orders of magnitude faster than plans generated by a traditional query optimizer. The additional complexity of considering expensive predicates during optimization is found to be manageably small.

References

  1. CGK89.Danette Chimenti, Ruben Gamboa, and Ravi Krishnamurthy. Towards an Open Architecture for LDL. In Proc. 15th International Conference on Very Large Data Bases, Amsterdam, August 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. D+90.O, Deux et al. The Story of 02. IEEE Transactions on Knowledge and Data Engineering, 2(1), March 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Day87.Umeshwar Dayal. Of Nests and Trees: A Unified Approach to #sing Queries that Contain Nested Subqueries, Aggregates, and Quantifiers. In Proc. VLDB 87 {Pro87}, pages 197-208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Han77.Michael Z. Hanani. An Optimal Evaluation of Boolean Expressions in an Online Query System. Communications of the ACM, 20(5):344-347, may 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. HCL+90.L.M. Haas, W. Chang, G.M. Lohman, J. McPherson, P.F. Wilms, G. Lapis, B. Lindsay, H. Pirahesh, M. Carey, and E. Shekita. Starburst Mid-Flight: As the Dust Clears. IEEE Transactions on Knowledge and Data Engineering, pages 143-160, March 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Hel92.Joseph M. Hellerstein. Predicate Migration: Optimizing Queries With Expensive Predicates. Technical Retxm Sequoia 2000 92/13, University of California, Berkeley, December 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. HOT88.Wen-Chi Hou, Gultekin Ozsoyoglu, and Baldeao K. Taneja. Statistical Estimators for Relational Algebra Expressions. In Proc. 7th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, pages 276-287, Austin, March 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. IK84.Toshihide Ibaraki and Tiko Kameda. Optimal Nesting for Computing N-relational Joins. ACM Transaction; on Database Systems, 9(3):482-502, October 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. ISO91.ISO.ANSI. Database Language SQL ISO/IEC 9075:1992, 1991.Google ScholarGoogle Scholar
  10. Jhi88.Anant Jhingran. A Performance Study of Query Optimization Algorithms on a Database System Sung Procedures. In Pro~. VLDB 88 {Pro88}. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. KBZ86.Ravi Krishnamunhy, Haran Boral, and Carlo Zaniolo. Optimization of Nonrecursive Queries. In Proc. 12th International Conference on Very Large Data Bases, pages 128-137, Kyoto, August 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. LDH+87.Guy M. Lohman, Dean Daniels, Laura M. Haas, Ruth Kistler, and Patricia G. Selinger. Optimization of Nested Queries in a Distributed Relational Database. in Proc. VLDB 87 ff#87. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. LNSS93.Richard J. Lipton, Jeffrey F. Naughton, Donovan A. Schneider, and S. Seshadri. Efficient Sampling Strategies for Relational Database Operations. To appear in Theoretical Computer Science, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. LS88.C. Lynch and M. Stonebraker.Extended User-Defined Indexing with Application to Textual Databases. In Proc. VLDB 88 tPro881. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Mos90.Claire Mosher (ed.). The POSTGRES Reference Manual, Volume 2. Technical Rqx# M90/53, Electronics Research Laboratory, University of California, Berkeley, July 1990.Google ScholarGoogle Scholar
  16. MS79.C. L. Monma and j.B. Sidney. Sequencing with Series- Parallel Precedence Constraints. Mathematics of Operations Research, 4:215-224, 1979.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. MS86.D. Maier and J. Stein. Indexing in an Object-Oriented DBMS. In Klaus R. Dittrich and Umeshwar Dayal, editors, Proc. Workshop on Object-Oriented Database Systems, Asilomar, September 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. MS87.D. Maier and J. Stein. Development and Implementation of an Object-Oriented DBMS. In Bruce Shrivcr and Peter Wegner, editors, Research Directions in Object-Oriented Programming. MIT Press, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Ols92.MichaelA. Olson. Extending the POSTGRES Database System to Manage Tertiary Storage. Master's thesis, University of California, Berkeley, May 1992.Google ScholarGoogle Scholar
  20. O'N89.E O'Neil. Revisiting DBMS Benchmarks. Datamation, pages 47-54, September 15, 1989.Google ScholarGoogle Scholar
  21. ONT92.ONTOS, Inc. ONTOS Object SQL Guide, February 1992. For the ONTOS DB database, Release 2.2.Google ScholarGoogle Scholar
  22. PHH92.Hamid Pirahesh, Joseph M. Hellerstein, and Waqar Hasan. Extensible#ule-Basexl Query Rewrite Optimization in Staxburst, in Proc. ACM-SIGMOD International Conference on Management of Data, pages 39-48, San Diego, June 1992, Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Pro87.Proc. 13th International Conference on Very Large Data Bases, Brighton, September 1987.Google ScholarGoogle Scholar
  24. Pro88.Proc. 14th International Conference on Very Large Data Bases, Los Angeles, August-September 1988.Google ScholarGoogle Scholar
  25. RS87.L.A. Rowe and M.R. Stonebraker. The POSTGRES Data Model. in Proc. VLDB 87 {F#87}, pages 83-96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. SAC+79.Patricia G. Selinger, M. Astrahan, D. Chamberlin, Raymond Lorie, and T. Price. Access Path Selection in a Relational Database Management System. In Proc. ACM- SIGMOD International Conference on Management of Data, Boston, June 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. SD92.Michael Stonebraker and Jeff Dozier. Sequoia 2000: Large Capacity Object Servers to Support Global Change Research. Technical Report Sequoia 2000 91/1, University of California, Berkeley, March 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. SFGM93.Michael Stonebraker, James Frew, Kenn Cmrdels, and Jeff Meredith. The Sequoia 2000 Storage Benchmark. In Proc. ACM-SIGMOD International Conference on Management of Data, Washington, D.C., May 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. SI92.Arun Swami and Balakrishna R. Iyer. A Polynomial Time Algorithm for Optimizing Join Queries. Research Report RJ 8812, IBM Almaden Research Center, June 1992.Google ScholarGoogle Scholar
  30. Smi56.W.E. Smith. Various Optimizers For Single-Stage Production. Naval Res. Logist. Quart., 3:59--66,1956.Google ScholarGoogle Scholar
  31. SR86.M#R. Stonebraker and L.A. Rowe. The Design of POST- GRES. In Proc. ACM-SIGMOD International Conference on Management of Data, Washington, D.C., May 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Sto91.Michael Stonebraker. Managing Persistent Objects in a Multi-Level Store. In Proc. ACM-SIGMOD International Conference on Management of Data, pages 2-11, Denver, June 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. TOB89.C. Turbyfill, C. Orji, and Dina Bitton. AS3AP - A Comparative Relational Database Benchmark. In Proc. IEEE Compcon Spring '89, February 1989.Google ScholarGoogle Scholar
  34. Ull89.Jeffrey D. UUman. Principles of Database and Knowledge- Base Systems, volume 2. Computer Science Press, 1989.Google ScholarGoogle Scholar
  35. WLH90.K. Wilkinson, P. Lyngbaek, and W. Hasan. The Iris Architecture and Implementation. IEEE Transactions on Knowledge and Data Engineering, 2(1), March 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Predicate migration: optimizing queries with expensive predicates

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                SIGMOD '93: Proceedings of the 1993 ACM SIGMOD international conference on Management of data
                June 1993
                566 pages
                ISBN:0897915925
                DOI:10.1145/170035

                Copyright © 1993 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 1 June 1993

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • Article

                Acceptance Rates

                Overall Acceptance Rate785of4,003submissions,20%

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader