arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.12713cs.DBcs.DScs.PF
收藏

实现基于比较的外部排序

Implementing the Comparison-Based External Sort

Michael Polyntsov, Valentin Grigorev, Kirill Smirnov, George Chernishev

摘要:

在大数据时代,排序是DBMS和类似系统不可或缺的操作。对数据进行排序可以帮助生成运行时间显著降低的查询计划。它还可以提供其他好处,例如具有非阻塞运算符,可以稳定地产生数据(没有突发),或者具有减少内存占用的运算符。查询处理的任何步骤都可能需要排序,即,无论是源数据还是中间结果。同时,要排序的数据可能不适合主存。在这种情况下,应该使用外部排序操作符,它将中间结果写入磁盘。在本文中,我们考虑了基于比较的排序类型的外部排序运算符。我们讨论了它的实现,并描述相关的设计决策。我们的目的是研究合并步骤中使用的数据结构对性能的影响。为此,我们已经实验性地评估了在DBMS内部实现的三种数据结构。结果表明,它是值得努力实现一个有效的数据结构运行合并,即使在现代商品计算机通常是磁盘绑定。此外,我们证明了使用失败者树是比朴素方法和基于堆的方法更有效的方法。

英文摘要:

In the age of big data, sorting is an indispensable operation for DBMSes and similar systems. Having data sorted can help produce query plans with significantly lower run times. It also can provide other benefits like having non-blocking operators which will produce data steadily (without bursts), or operators with reduced memory footprint. Sorting may be required on any step of query processing, i.e., be it source data or intermediate results. At the same time, the data to be sorted may not fit into main memory. In this case, an external sort operator, which writes intermediate results to disk, should be used. In this paper we consider an external sort operator of the comparison-based sort type. We discuss its implementation and describe related design decisions. Our aim is to study the impact on performance of a data structure used on the merge step. For this, we have experimentally evaluated three data structures implemented inside a DBMS. Results have shown that it is worthwhile to make an effort to implement an efficient data structure for run merging, even on modern commodity computers which are usually disk-bound. Moreover, we demonstrated that using a loser tree is a more efficient approach than both the naive approach and the heap-based one.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑