Lune

PLDI2026Top-tier venue

A Compiler for Fused Relational Operations on Multisets

James Dong, Fredrik Kjolstad

2026Year

Abstract

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 × .

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext ba471b0a-f185-4bfd-8284-5c4dfc8e3cdc

Builds on7

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines