Affiliation:
1. Celonis Inc., New York, NY, USA
2. Google Inc., Madison, WI, USA
Abstract
Database query processing requires algorithms for duplicate removal, grouping, and aggregation. Three algorithms exist: in-stream aggregation is most efficient by far but requires sorted input; sort-based aggregation relies on external merge sort; and hash aggregation relies on an in-memory hash table plus hash partitioning to temporary storage. Cost-based query optimization chooses which algorithm to use based on several factors, including the sort order of the input, input and output sizes, and the need for sorted output. For example, hash-based aggregation is ideal for output smaller than the available memory (e.g., Query 1 of TPC-H), whereas sorting the entire input and aggregating after sorting are preferable when both aggregation input and output are large and the output needs to be sorted for a subsequent operation such as a merge join.
Unfortunately, the size information required for a sound choice is often inaccurate or unavailable during query optimization, leading to sub-optimal algorithm choices. In response, this article introduces a new algorithm for sort-based duplicate removal, grouping, and aggregation. The new algorithm always performs at least as well as both traditional hash-based and traditional sort-based algorithms. It can serve as a system’s only aggregation algorithm for unsorted inputs, thus preventing erroneous algorithm choices. Furthermore, the new algorithm produces sorted output that can speed up subsequent operations. Google’s F1 Query uses the new algorithm in production workloads that aggregate petabytes of data every day.
Publisher
Association for Computing Machinery (ACM)
Reference40 articles.
1. TPC. 2021. TPC-H benchmark. Retrieved from http://www.tpc.org/tpch/.
2. Napa: Powering scalable data warehousing with robust query performance at Google;Agiwal Ankur;Proc. VLDB Endow.,2021
3. Organization and maintenance of large ordered indexes
4. Duplicate record elimination in large data files
5. Peter Boncz, Thomas Neumann, and Orri Erling. 2013. TPC-H analyzed: Hidden messages and lessons learned from an influential benchmark. In Proceedings of the 5th TPC Technology Conference on Performance Characterization and Benchmarking, Volume 8391. Springer-Verlag, Berlin, 61–76. DOI:10.1007/978-3-319-04936-6_5
Cited by
5 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. An FPGA based Scheme for Real-Time Max/Min-Set-Selection Sorters;2024 1st International Conference on Cognitive, Green and Ubiquitous Computing (IC-CGU);2024-03-01
2. Database management system performance comparisons: A systematic literature review;Journal of Systems and Software;2024-02
3. More Modern B-Tree Techniques;Foundations and Trends® in Databases;2024
4. High-Performance and Flexible Parallel Algorithms for Semisort and Related Problems;Proceedings of the 35th ACM Symposium on Parallelism in Algorithms and Architectures;2023-06-17
5. Robust and Efficient Sorting with Offset-value Coding;ACM Transactions on Database Systems;2023-03-13