[论文解读] Massively Parallel Sort-Merge Joins in Main Memory Multi-Core Database Systems
本文提出了一种大规模并行排序-合并(MPSM)连接算法,适用于主内存、多核数据库系统,通过非统一内存访问(NUMA)感知的分区排序实现可扩展的高性能等值连接。通过在本地内存中并行排序独立运行的分区,并增量式地合并结果,MPSM 在 32 核系统上实现了接近线性的扩展性,在十亿级元组数据集上性能优于最先进的哈希连接引擎 Vectorwise 四倍。
Two emerging hardware trends will dominate the database system technology in the near future: increasing main memory capacities of several TB per server and massively parallel multi-core processing. Many algorithmic and control techniques in current database technology were devised for disk-based systems where I/O dominated the performance. In this work we take a new look at the well-known sort-merge join which, so far, has not been in the focus of research in scalable massively parallel multi-core data processing as it was deemed inferior to hash joins. We devise a suite of new massively parallel sort-merge (MPSM) join algorithms that are based on partial partition-based sorting. Contrary to classical sort-merge joins, our MPSM algorithms do not rely on a hard to parallelize final merge step to create one complete sort order. Rather they work on the independently created runs in parallel. This way our MPSM algorithms are NUMA-affine as all the sorting is carried out on local memory partitions. An extensive experimental evaluation on a modern 32-core machine with one TB of main memory proves the competitive performance of MPSM on large main memory databases with billions of objects. It scales (almost) linearly in the number of employed cores and clearly outperforms competing hash join proposals - in particular it outperforms the "cutting-edge" Vectorwise parallel query engine by a factor of four.
研究动机与目标
- 解决传统排序-合并连接在现代多核主内存数据库中的性能瓶颈,其中 I/O 不再是主要开销。
- 克服经典排序-合并连接的可扩展性限制,后者依赖于集中式、难以并行化的最终合并步骤。
- 设计一种利用 NUMA 架构的连接算法,使数据和计算尽可能靠近核心,减少远程内存访问和同步开销。
- 在现代 32 核、TB 级主内存服务器上实现高性能和线性可扩展性,超越现有的哈希连接和基数连接方法。
- 为内存数据库上的操作型业务智能工作负载实现高效、低延迟的实时查询处理。
提出的方法
- 采用部分分区排序:每个核心独立将其分配的数据分区排序为本地运行,避免全局同步。
- 应用 NUMA 感知的数据放置策略,使每个核心在其本地内存节点上排序和处理数据,降低延迟和带宽压力。
- 在并行的已排序运行上增量式执行合并连接,消除对集中式最终合并步骤的需求。
- 使用基于直方图的、无同步的分区策略,实现在构建阶段高效、低开销的数据分发。
- 在每个核心的私有内存空间内,实现一种自定义的基数排序/快速排序混合算法,以高效完成内部排序。
- 在合并阶段利用顺序访问模式,最大化缓存和硬件预取器的效率。
实验结果
研究问题
- RQ1能否重新设计一种排序-合并连接,使其在主内存、多核环境中实现接近线性的扩展性,支持数百个核心?
- RQ2避免集中式最终合并步骤,转而并行合并独立运行,是否能带来比传统排序-合并或哈希连接方法更好的性能和 NUMA 效率?
- RQ3在大规模主内存数据上,NUMA 优化的排序-合并连接与顶尖哈希连接引擎(如 Vectorwise 和 Wisconsin 哈希连接)相比性能如何?
- RQ4在不依赖复杂同步机制或动态内存分配的前提下,能在多大程度上利用缓存局部性和硬件预取机制优化并行排序-合并连接?
- RQ5MPSM 中本地已排序运行的物理特性是否可用于优化后续查询操作?
主要发现
- 在 1TB 主内存、32 核服务器上,MPSM 在 32 个核心上实现了接近线性的扩展性,展现出强大的水平可扩展性。
- 在十亿级元组数据集上,尽管 Vectorwise 使用了先进的基数连接和向量化处理技术,MPSM 的性能仍比其高出四倍。
- MPSM 的性能优势源于其 NUMA 友好的设计,有效减少了远程内存访问并避免了细粒度同步。
- 通过消除集中式最终合并步骤,MPSM 避免了经典排序-合并连接中显著的可扩展性瓶颈。
- 对已排序运行的增量式合并提供了良好的缓存局部性,并受益于硬件预取,提升了内存访问效率。
- 该算法的输出——本地已排序的运行——可能有助于优化后续操作,例如半连接或半连接下推,类似于传统排序-合并连接的优化机制。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。