Efficient Sorting, Duplicate Removal, Grouping, and Aggregation

Author:

Do Thanh1ORCID,Graefe Goetz2ORCID,Naughton Jeffrey1ORCID

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)

Subject

Information Systems

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

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3