A Compiler for Fused Relational Operations on Multisets
James Dong, Fredrik Kjolstad
摘要
We describe a comprehensive compilation approach for relational algebra, centered on an abstract loop-based intermediate representation (IR) that can express fused implementations of relational algebra operators on both sets and multisets. The loops are abstracted away from physical data structures thus making it easier to optimize. We show how to lower relational algebra query plan trees to the IR, including the complex operators that are used in production database systems, such as 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 relational algebra expressions. Finally, we show that our approach is portable across data structures. Since our approach can fuse across disparate operators, it achieves a 3.8 × speedup ( 0.8 – 12.1 × ) compared to Hyper on selected LSQB benchmarks and worst-case optimal triangle queries. Our compiler also generates code of high quality: it has similar sequential performance to Hyper on TPC-H with a 1.0 × speedup ( 0.4 – 4.3 × ) and is approaching their parallel performance with a 0.6 × speedup 0.2 – 1.8 × .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
它引用的 Paper7
- Adopting Worst-Case Optimal Joins in Relational Database SystemsMichael J. Freitag, Maximilian Bandle, Tobias Schmidt, Alfons Kemper 等VLDB 2020 · 79 次引用
- A sparse iteration space transformation framework for sparse tensor algebraRyan Senanayake, Changwan Hong, Ziheng Wang, Amalee Wilson 等OOPSLA 2020 · 51 次引用
- Functional collection programming with semi-ring dictionariesAmir Shaikhha, Mathieu Huot, Jaclyn Smith, Dan OlteanuOOPSLA 2022 · 31 次引用
- Compilation of sparse array programming modelsRawn Henry, Olivia Hsu, Rohan Yadav, Stephen Chou 等OOPSLA 2021 · 26 次引用
- Free Join: Unifying Worst-Case Optimal and Traditional JoinsYisu Remy Wang, Max Willsey, Dan SuciuSIGMOD 2023 · 18 次引用
相关 Paper
- Building Advanced SQL Analytics From Low-Level Plan OperatorsAndré Kohn, Viktor Leis, Thomas NeumannSIGMOD 2021 · 13 次引用
- Computing the Difference of Conjunctive Queries EfficientlyXiao Hu, Qichen WangSIGMOD 2023 · 9 次引用
- Incremental Fusion: Unifying Compiled and Vectorized Query ExecutionBenjamin Wagner, André Kohn, Peter Boncz, Viktor LeisICDE 2024 · 3 次引用
- HADAD: A Lightweight Approach for Optimizing Hybrid Complex Analytics QueriesRana Alotaibi, Bogdan Cautis, Alin Deutsch, Ioana ManolescuSIGMOD 2021 · 4 次引用
- Asymptotically Better Query Optimization Using Indexed AlgebraPhilipp Fent, Guido Moerkotte, Thomas NeumannVLDB 2023 · 5 次引用
