arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2502.06988cs.PLcs.DB
收藏

一种支持包语义的关系运算编译器

A Compiler for Operations on Relations with Bag Semantics

James Dong, Fredrik Kjolstad

AI总结:

本文提出一种基于抽象循环的中间表示,支持集合和包上关系代数表达式的融合实现,能编译为高效C++代码,在LSQB基准等测试中获3.87倍加速,TPC-H顺序性能与Hyper相当,且可跨数据结构移植。

摘要:

我们提出一种基于抽象循环的中间表示,可表达集合和包(多重集)上关系代数表达式的融合实现。该循环与物理数据结构解耦,便于生成、推理及执行融合等优化。此中间表示支持常规关系代数及生产数据库系统中的复杂算子,包括外连接、非等值连接和差运算。随后,我们展示如何将该中间表示编译为高效C++代码,以协同迭代关系代数表达式中的物理数据结构。我们的方法可实现不同算子间的融合,在选定的LSQB基准测试和最坏情况最优三角形查询中带来3.87倍加速(范围0.77--12.23倍)。我们还证明编译器生成的代码质量很高:在TPC-H上的顺序性能与Hyper相当,加速比为1.00倍(范围0.38--4.34倍);并行性能具有竞争力,加速比为0.61倍(范围0.23--1.80倍)。最后,我们的方法可跨数据结构移植。

英文摘要:

We describe an abstract loop-based intermediate representation that can express fused implementations of relational algebra expressions on sets and bags (multisets). The loops are abstracted away from physical data structures thus making it easier to generate, reason about, and perform optimization like fusion on. The IR supports the natural relational algebra as well as complex operators that are used in production database systems, including outer joins, non-equi joins, and differences. We then show how to compile this IR to efficient C++ code that co-iterates over the physical data structures present in the relational algebra expression. Our approach lets us express fusion across disparate operators, leading to a 3.87x speedup (0.77--12.23x) on selected LSQB benchmarks and worst-case optimal triangle queries. We also demonstrate that our compiler generates code of high quality: it has similar sequential performance to Hyper on TPC-H with a 1.00x speedup (0.38--4.34x) and competitive parallel performance with a 0.61x speedup (0.23--1.80x). Finally, our approach is portable across data structures.

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

↑