Skip to main content

A new heuristic for optimizing large queries

  • Conference paper
  • First Online:
Database and Expert Systems Applications (DEXA 1998)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1460))

Included in the following conference series:

Abstract

There is a number of OODB optimization techniques proposed recently, such as the translation of path expressions into joins and query unnesting, that may generate a large number of implicit joins even for simple queries. Unfortunately, most current commercial query optimizers are still based on the dynamic programming approach of System R, and cannot handle queries of more than ten tables. There is a number of recent proposals that advocate the use of combinatorial optimization techniques, such as iterative improvement and simulated annealing, to deal with the complexity of this problem. These techniques, though, fail to take advantage of the rich semantic information inherent in the query specification, such as the information available in query graphs, which gives a good handle to choose which relations to join each time. This paper presents a polynomial-time algorithm that generates a good quality order of relational joins. It is a bottom-up greedy algorithm that always performs the most profitable joins first. Our heuristic is superior to related approaches in that it generates bushy trees, it takes into account both the sizes of intermediate results and the predicate selectivities, and it always updates the query graph to reflect the new sizes and the new selectivities.

This work is supported in part by the National Science Foundation under grant IRI-9509955.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. R. Cattell. The Object Database Standard: ODMG-93. Morgan Kaufmann, 1994.

    Google Scholar 

  2. S. Cluet and C. Delobel. A General Framework for the Optimization of Object-Oriented Queries. Proceedings of the ACM-SIGMOD International Conference on Management of Data, San Diego, California, pp 383–392, June 1992.

    Google Scholar 

  3. L. Fegaras. Optimizing Large OODB Queries. In Fifth International Conference on Deductive and Object-Oriented Databases, Montreux, Switzerland, December 1997.

    Google Scholar 

  4. L. Fegaras. A New Heuristic for Optimizing Large Queries (extended paper). Available at http://www-cse.uta.edu/~fegaras/order.ps.gz, February 1998.

    Google Scholar 

  5. L. Fegaras. Query Unnesting in Object-Oriented Databases. ACM SIGMOD International Conference on Management of Data, Seattle, Washington, June 1998.

    Google Scholar 

  6. T. Ibaraki and T. Kameda. Optimal Nesting for Computing N-Relational Joins. ACM Transactions on Database Systems, 9(3):482–502, September 1984.

    Article  MathSciNet  Google Scholar 

  7. Y. Ioannidis and Y. Kang. Randomized Algorithms for Optimizing Large Join Queries. In Proceedings of the 1990 ACM SIGMOD International Conference on Management of Data, Atlantic City, NJ, pp 312–321, May 1990.

    Google Scholar 

  8. Y. Ioannidis and Y. Kang. Left-deep vs. Bushy Trees: An Analysis of Strategy Spaces and its Implications for Query Optimization. Proceedings of the ACM-SIGMOD International Conference on Management of Data, Denver, Colorado, 20(2):168–177, May 1991.

    Google Scholar 

  9. R. Krishnamurthy, H. Boral, and C. Zaniolo. Optimization of Nonrecursive Queries. In Y. Kambayashi, editor, Proceedings of the Twelfth International Conference on Very Large Databases, Kyoto, Japan, pp 128–137, August 1986.

    Google Scholar 

  10. M. Muralikrishna. Improved Unnesting Algorithms for Join Aggregate SQL Queries. In Proc. Int'l. Conf. on Very Large Data Bases, page 91, Vancouver, BC, Canada, August 1992.

    Google Scholar 

  11. K. Ono and G. Lohman. Measuring the Complexity of Join Enumeration in Relational Query Optimization. In Proceedings of the 16th Conference on Very Large Databases, Morgan Kaufman pubs. (Los Altos CA), Brisbane, August 1990.

    Google Scholar 

  12. W. Scheufele and G. Moerkotte. Efficient Dynamic Programming Algorithms for Ordering Expensive Joins and Selections. International Conference on Extending Data Base Technology, Valencia, Spain, March 1997.

    Google Scholar 

  13. P. Selinger, M. Astrahan, D. Chamberlin, R. Lorie, and T. Price. Access Path Selection in a Relational Database Management System. Proceedings of the ACM-SIGMOD International Conference on Management of Data, Boston, Massachusetts, pp 23–34, May 1979.

    Google Scholar 

  14. M. Steinbrunn, G. Moerkotte, and A. Kemper. Heuristic and Randomized Optimization for the Join Ordering Problem. VLDB Journal, 6(3):191–208, 1997.

    Article  Google Scholar 

  15. A. Swami. Optimization of Large Join Queries: Combining Heuristics and Combinatorial Techniques. In Proceedings of the ACM-SIGMOD International Conference on Management of Data, Portland, Oregon, pp 367–376, May 1989.

    Google Scholar 

  16. A. Swami and A. Gupta. Optimization of Large Join Queries. Proceedings of the ACM-SIGMOD International Conference on Management of Data, Chicago, Illinois, 13(3):8–17, September 1988.

    Google Scholar 

  17. K. Youssefi and E. Wong. Query Processing in a Relational Database Management System. In Proceedings of the Fifth International Conference on Very Large Databases, pp 409–417, 1979.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Gerald Quirchmayr Erich Schweighofer Trevor J.M. Bench-Capon

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Fegaras, L. (1998). A new heuristic for optimizing large queries. In: Quirchmayr, G., Schweighofer, E., Bench-Capon, T.J. (eds) Database and Expert Systems Applications. DEXA 1998. Lecture Notes in Computer Science, vol 1460. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0054528

Download citation

  • DOI: https://doi.org/10.1007/BFb0054528

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-64950-2

  • Online ISBN: 978-3-540-68060-4

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics