Leapfrog Triejoin: a worst-case optimal join algorithm
arXiv:1210.0481
Abstract
Recent years have seen exciting developments in join algorithms. In 2008, Atserias, Grohe and Marx (henceforth AGM) proved a tight bound on the maximum result size of a full conjunctive query, given constraints on the input relation sizes. In 2012, Ngo, Porat, R{é} and Rudra (henceforth NPRR) devised a join algorithm with worst-case running time proportional to the AGM bound. Our commercial Datalog system LogicBlox employs a novel join algorithm, \emph{leapfrog triejoin}, which compared conspicuously well to the NPRR algorithm in preliminary benchmarks. This spurred us to analyze the complexity of leapfrog triejoin. In this paper we establish that leapfrog triejoin is also worst-case optimal, up to a log factor, in the sense of NPRR. We improve on the results of NPRR by proving that leapfrog triejoin achieves worst-case optimality for finer-grained classes of database instances, such as those defined by constraints on projection cardinalities. We show that NPRR is \emph{not} worst-case optimal for such classes, giving a counterexample where leapfrog triejoin runs in time, compared to time for NPRR. On a practical note, leapfrog triejoin can be implemented using conventional data structures such as B-trees, and extends naturally to queries. We believe our algorithm offers a useful addition to the existing toolbox of join algorithms, being easy to absorb, simple to implement, and having a concise optimality proof.
Cited by in corpus (14)
- SkinnerDB: Regret-Bounded Query Evaluation via Reinforcement Learning
- Skew Strikes Back: New Developments in the Theory of Join Algorithms
- EmptyHeaded: A Relational Engine for Graph Processing
- Incremental Maintenance for Leapfrog Triejoin
- Transaction Repair: Full Serializability Without Locks
- It's all a matter of degree: Using degree information to optimize multiway joins
- Memory-Efficient Group-by Aggregates over Multi-Way Joins
- Integrating Datalog and Constraint Solving
- Beyond Worst-Case Analysis for Joins with Minesweeper
- Implementation of Tetris as a Model Counter
- LevelHeaded: Making Worst-Case Optimal Joins Work in the Common Case
- Efficient Multiway Hash Join on Reconfigurable Hardware
- Worst-Case Optimal Radix Triejoin
- Covering the Relational Join