Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

Reusing invariants: a new strategy for correlated queries

Published: 01 June 1998 Publication History

Abstract

Correlated queries are very common and important in decision support systems. Traditional nested iteration evaluation methods for such queries can be very time consuming. When they apply, query rewriting techniques have been shown to be much more efficient. But query rewriting is not always possible. When query rewriting does not apply, can we do something better than the traditional nested iteration methods? In this paper, we propose a new invariant technique to evaluate correlated queries efficiently. The basic idea is to recognize the part of the subquery that is not related to the outer references and cache the result of that part after its first execution. Later, we can reuse the result and combine it with the result of the rest of the subquery that is changing for each iteration. Our technique applies to arbitrary correlated subqueries.
This paper introduces algorithms to recognize the invariant part of a data flow tree, and to restructure the evaluation plan to reuse the stored intermediate result. We also propose an efficient method to teach an existing join optimizer to understand the invariant feature and thus allow it to be able to generate better join plans in the new context. Some other related optimization techniques are also discussed. The proposed techniques were implemented within three months on an existing real commercial database system.
We also experimentally evaluate our proposed technique. Our evaluation indicates that, when query rewriting is not possible, the invariant technique is significantly better than the traditional nested iteration method. Even when query rewriting applies, the invariant technique is sometimes better than the query rewriting technique. Our conclusion is that the invariant technique should be considered as one of the alternatives in evaluating correlated queries since it fills the gap left by rewriting techniques.

References

[1]
Randy Bello. Invariant subplans in dataflow. Sybase IQ Internal Engineering Document~ 1996.
[2]
Hong-Tai Chou and David J. Dewitt. An evaluation of buffer management strategies for relational database systems. In Proceedings of the 11th VLDB Conference, pages 127-141, 1985.
[3]
Damianos Chatziantoniou. Optimization of Complex Aggregate Queries in Relational Databases. PhD thesis, Department of Computer Science, Columbia University, 1997.
[4]
Damianos Chatziantoniou and Kenneth A. Ross. Groupwise processing of relational queries. In Proceedings of the 23th VLDB Conference, pages 476-485, 1997.
[5]
Umeshwar Dayal. Of nests and trees: A unified approach to processing queries that contain nested subqueries, aggregates and quantifiers. In P~vceedings of the 13th VLDB Conference, pages 197-208, 1987.
[6]
Goetz Graefe. Volcano, an extensible and paralIel query evaluation system. IEEE Transactions on knowledge and data enginnering, 6(6):934-944, 1994.
[7]
Richard A. Ganski and Harry K.T. Wong. Optimization of nested sql queries revisited. In Proceedings of the A CM SIGMOD Conference, pages 23-33, 1987.
[8]
Joseph M. Hetlerstein. Practical predicate placement. In Proceedings of the ACM SIG- MOD Conference, pages 325-335, 1994.
[9]
Joseph M. Hellerstein, Peter J. Haas, and elen J. Wang. Online aggregation. In Proceedings of the A CM SIGMOD Conference, pages 171-182, 1997.
[10]
Joseph M. Hellerstein and Jeffrey F. Naughton. Query execution techniques for caching expensive methods. In Proceedings of the A CM SIGMOD Conference, pages 423- 433, 1996.
[11]
Roberto J. Bayardo Jr. and Daniel P. Miranker. Processing queries for first few answers. In Proceedings of the Fifth International Conference on Information and Knowledge Management, pages 45-52, 1996.
[12]
Won Kim. On optimizing an sql-like nested query. A CM Transactions on Database Systems, 7(3):443-469, 1982.
[13]
Dan Leary. Dataflow operators feature specification. Sybase IQ Internal Engineering Document, 1996.
[14]
Donald Michie. "memo" functions and machine learning. Nature, 218:19-22, 1968.
[15]
Kiyoshi Ono and Guy M. Lohman. Mensuring the complexity of join enumeration in query optimization. In Proceedings of the I6th VLDB Conference, pages 314-325, 1990.
[16]
Patrick O'Neil and Dallan Quas. Improved query performance with variant indexes. In Proceedings of the A CM SIGMOD Conference, pages 38-49, 1997.
[17]
Glenn Paulley, 1997. personal communication.
[18]
Hamid Pirahesh, Joseph M. Hellerstein, and Waqar Hasan. Extensible/rule based query rewrite optimization in startburst. In Proceedings of the A CM SIGMOD Conference, pages 39-38, 1992.
[19]
Patricia G. Selinger, Morton M. Astrahan, Donald D. Chamberlin, Raymond A. Lorie, and Thomsa G. Price. Access path selection in a relational database management system. In Proceedings of the A CM SIGMOD Conference, pages 23-34, 1979.
[20]
Timos K. Sellis. Multiple-query optimization. A CM Transactions on Database Systems, 13(1):23-52, 1988.
[21]
Timos K. Sellis and Subrata Ghosh. On the multiple-query optimization problem. IEEE Transactions on knowledge and data enginnering, 2(2):262-266, 1990.
[22]
Praveen Seshadri, Hamid Pirahesh, and T.Y.Cliff Leung. Complex query decorrelation. In Proc. IEEE Int'l Conf. on Data Eng., pages 450-458, 1996.
[23]
David Simmen, Eugene Shekita, and Timothy Malkemus. Fundamental techniques for order optimization. In Proceedings of the A CM SIGMOD Conference, pages 57-67, 1996.
[24]
Sybase Corporation. Adaptive Server Enterprise 11.5, 1997.
[25]
Sybase Corporation. Sybase IQ 11.2.1, 1997.
[26]
Tpc-d benchmark standard specification (revision 1.0). May 1995.
[27]
Weipeng P. Yah and Per-Ake Larson. Eager aggregation and lazy aggregation. In Proceedings of the 21th VLDB Conference, pages 345-357, 1995.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGMOD Record
ACM SIGMOD Record  Volume 27, Issue 2
June 1998
595 pages
ISSN:0163-5808
DOI:10.1145/276305
Issue’s Table of Contents
  • cover image ACM Conferences
    SIGMOD '98: Proceedings of the 1998 ACM SIGMOD international conference on Management of data
    June 1998
    599 pages
    ISBN:0897919955
    DOI:10.1145/276304
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: 01 June 1998
Published in SIGMOD Volume 27, Issue 2

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)119
  • Downloads (Last 6 weeks)22
Reflects downloads up to 08 Feb 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media