Nothing Special   »   [go: up one dir, main page]

skip to main content
article

Orthogonal optimization of subqueries and aggregation

Published: 01 May 2001 Publication History

Abstract

There is considerable overlap between strategies proposed for subquery evaluation, and those for grouping and aggregation. In this paper we show how a number of small, independent primitives generate a rich set of efficient execution strategies —covering standard proposals for subquery evaluation suggested in earlier literature. These small primitives fall into two main, orthogonal areas: Correlation removal, and efficient processing of outerjoins and GroupBy. An optimization approach based on these pieces provides syntax-independence of query processing with respect to subqueries, i. e. equivalent queries written with or without subquery produce the same efficient plan.
We describe techniques implemented in Microsoft SQL Server (releases 7.0 and 8.0) for queries containing sub-queries and/or aggregations, based on a number of orthogonal optimizations. We concentrate separately on removing correlated subqueries, also called “query flattening,” and on efficient execution of queries with aggregations. The end result is a modular, flexible implementation, which produces very efficient execution plans. To demonstrate the validity of our approach, we present results for some queries from the TPC-H benchmark. From all published TPC-H results in the 300GB scale, at the time of writing (November 2000), SQL Server has the fastest results on those queries, even on a fraction of the processors used by other systems.

References

[1]
P. Celis and H. Zeller. Subquery elimination: A complete unnesting algorithm for an extended relational algebra. In Proceedings of the Thirteenth International Conference on Data Engineering, April 7-11, 1997 Birmingham U.K, page 321, 1997.
[2]
D. Chatziantoniou and K. A. Ross. Groupwise processing of relational queries. In Proceedings of the 23rd International Conference on Very Large Databases, Athens, pages 476-485, 1997.
[3]
S. Chaudhuri and K. Shim. Including Group-By in query optimization. In Proceedings of the Twentieth International Conference on Very Large Databases, Santiago, pages 354-366, 1994.
[4]
S. Cluet and C. Delobel. A general framework for the optimization of object-oriented queries. In Proceedings of ACM SIGMOD 1992, pages 383-392, 1992.
[5]
U. Dayal. Of nests and trees: A unified approach to processing queries that contain nested subqueries, aggregates, and quantifiers. In Proceedings of the Thirteenth International Conference on Very Large Databases, Brighton, pages 197-208, 1987.
[6]
C. A. Galindo-Legaria. Parameterized queries and nesting equivalences. Technical report, Microsoft, 2001. MSR-TR-2000-31.
[7]
C. A. Galindo-Legaria and A. Rosenthal. Outerjoin simplification and reordering for query optimization. ACM Transactions on Database Systems, 22(1):43-73, Mar. 1997.
[8]
G. Graefe. The Cascades framework for query optimization. Data Engineering Bulletin, 18(3):19-29, 1995.
[9]
G. Graefe and W. J. McKenna. The volcano optimizer generator: Extensibility and efficient. In Proceedings of the Ninth International Conference on Data Engineering, Viena, Austria, pages 209-218, 1993.
[10]
M. M. Joshi and C. A. Galindo-Legaria. Properties of the GroupBy/Aggregate relational operator. Technical report, Microsoft, 2001. MSR-TR-2001-13.
[11]
W. Kim. On optimizing an SQL-like nested query. ACM Transactions on Database Systems, 7(3):443-469, Sept. 1982.
[12]
T. Leung, G. Mitchell, B. Subramanian, B. Vance, S. L. Vandenberg, and S. B. Zdonik. The AQUA data model and algebra. In DBPL, pages 157-175, 1993.
[13]
J. Melton and A. R. Simon. Understanding the new SQL: A complete guide. Morgan Kaufmann, San Francisco, 1993.
[14]
H. Pirahesh, J. M. Hellerstein, and W. Hasan. Extensible/rule based query rewrite optimization in starburst. In Proceedings of ACM SIGMOD 1992, pages 39-48, 1992.
[15]
P. Seshadri, H. Pirahesh, and T. Y. C. Leung. Complex query decorrelation. In Proceedings of the Twelfth International Conference on Data Engineering, New Orleans, Luisiana, pages 450-458, 1996.
[16]
G. Shaw and S. Zdonik. An object-oriented query algebra. In Proceedings of the Second International Workshop on Database Programming Languages, pages 249-225, 1989.
[17]
Q. Wang, D. Maier, and L. Shapiro. Algebraic unnesting of nested object queries. Technical report, Oregon Graduate Institute, 1999. CSE-99-013.
[18]
Y. P. Yan and P. A. Larson. Eager aggregation and lazy aggregation. In Proceedings of the 21st International Conference on Very Large Databases, Zurich, pages 345-357, 1995.

Cited By

View all
  • (2024)In-depth Analysis of Continuous Subgraph Matching in a Common Delta Query Compilation FrameworkProceedings of the ACM on Management of Data10.1145/36549502:3(1-27)Online publication date: 30-May-2024
  • (2024)Sharing Queries with Nonequivalent User-defined Aggregate FunctionsACM Transactions on Database Systems10.1145/364913349:2(1-46)Online publication date: 10-Apr-2024
  • (2023)Controlling the Correctness of Aggregation Operations During Sessions of Interactive Analytic QueriesJournal of Data and Information Quality10.1145/357581215:2(1-41)Online publication date: 23-Jun-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGMOD Record
ACM SIGMOD Record  Volume 30, Issue 2
June 2001
625 pages
ISSN:0163-5808
DOI:10.1145/376284
Issue’s Table of Contents
  • cover image ACM Conferences
    SIGMOD '01: Proceedings of the 2001 ACM SIGMOD international conference on Management of data
    May 2001
    630 pages
    ISBN:1581133324
    DOI:10.1145/375663
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 May 2001
Published in SIGMOD Volume 30, Issue 2

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)69
  • Downloads (Last 6 weeks)14
Reflects downloads up to 23 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)In-depth Analysis of Continuous Subgraph Matching in a Common Delta Query Compilation FrameworkProceedings of the ACM on Management of Data10.1145/36549502:3(1-27)Online publication date: 30-May-2024
  • (2024)Sharing Queries with Nonequivalent User-defined Aggregate FunctionsACM Transactions on Database Systems10.1145/364913349:2(1-46)Online publication date: 10-Apr-2024
  • (2023)Controlling the Correctness of Aggregation Operations During Sessions of Interactive Analytic QueriesJournal of Data and Information Quality10.1145/357581215:2(1-41)Online publication date: 23-Jun-2023
  • (2022)Practical planning and execution of groupjoin and nested aggregatesThe VLDB Journal10.1007/s00778-022-00765-x32:6(1165-1190)Online publication date: 22-Oct-2022
  • (2021)A practical approach to groupjoin and nested aggregatesProceedings of the VLDB Endowment10.14778/3476249.347628814:11(2383-2396)Online publication date: 27-Oct-2021
  • (2021)iTurboGraphProceedings of the 2021 International Conference on Management of Data10.1145/3448016.3457243(977-990)Online publication date: 9-Jun-2021
  • (2021)NestGPU: Nested Query Processing on GPU2021 IEEE 37th International Conference on Data Engineering (ICDE)10.1109/ICDE51399.2021.00092(1008-1019)Online publication date: Apr-2021
  • (2019)BlackMagicProceedings of the VLDB Endowment10.14778/3352063.335207212:12(1810-1813)Online publication date: 1-Aug-2019
  • (2019)ProvCiteProceedings of the VLDB Endowment10.14778/3317315.331731712:7(738-751)Online publication date: 1-Mar-2019
  • (2018)FroidProceedings of the VLDB Endowment10.1145/3164135.316414011:4(432-444)Online publication date: 5-Oct-2018
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media