NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Join Processing for Graph Patterns: An Old Dog with New Tricks

Dung T. Nguyen, Molham Aref, Martin Bravenboer, George Kollias, Hung Q. Ngo, Christopher Ré, Atri Rudra

Abstract

Relational database management systems (RDBMS) have long been considered suboptimal for graph analytics due to the limitations of traditional Selinger-style join optimizers when handling cyclic patterns. This paper presents a paradigm shift by implementing "worst-case optimal" and "beyond worst-case" join algorithms within a standard relational engine. By utilizing Leapfrog Triejoin (LFTJ) and the novel Minesweeper (MS) algorithm, the authors show that an RDBMS can achieve performance improvements of several orders of magnitude over traditional SQL engines and even outperform specialized graph databases.

Introduction

The core challenge in graph-pattern queries, such as finding cliques or cycles in social networks, lies in the inefficiency of pairwise joins. Traditional optimizers join two tables at a time, often generating massive intermediate results that are eventually discarded. This "performance gap" has led to the rise of specialized graph engines. This research investigates whether this gap is a fundamental limitation of the relational model or merely a consequence of outdated join algorithms.

Methodology

The authors integrated two classes of advanced algorithms into the LogicBlox RDBMS to address these inefficiencies.

Leapfrog Triejoin (LFTJ)

LFTJ is a worst-case optimal algorithm that performs multiway joins by intersecting multiple relations simultaneously. Unlike pairwise joins, LFTJ represents data in a trie structure, allowing it to "leapfrog" over large sections of data that cannot contribute to the final result. This ensures that the runtime is proportional to the theoretically maximum output size, providing a significant advantage for cyclic queries.

Trie representation of a relational table for multiway joins.

Minesweeper (MS)

Minesweeper is a "beyond worst-case" (instance-optimal) algorithm that treats the join as a search in a multi-dimensional space. It identifies "gap boxes"—geometric regions where no data exists—and caches them to prune the search space. This allows the engine to dynamically learn the topology of the data during query execution.

Minesweeper algorithm data structure showing interval-based pruning.

Hybrid Approach

For complex "lollipop" queries—consisting of a path followed by a clique—the authors developed a hybrid approach. This strategy leverages Minesweeper for the path component and LFTJ for the clique component, optimizing the execution for mixed structural patterns.

Experimental Evaluation

The evaluation utilized a wide variety of real-world social and communication network datasets from the SNAP collection, including Facebook, Twitter, Orkut, and Wiki-Vote. The queries focused on structural patterns such as 3-cliques (triangles), 4-cliques, 4-cycles, and various path and tree structures.

Key Results and Insights

  • Significant Speedups: LogicBlox, using LFTJ and MS, was often 10x to 1000x faster than traditional RDBMS like Postgres and MonetDB on cyclic queries.
  • Competitive Performance: The system outperformed specialized graph stores like Neo4j and Virtuoso across most benchmarks. While specialized engines like GraphLab were fast on small cliques, they often failed on larger datasets due to memory constraints.
  • Acyclic Superiority: Minesweeper proved to be the superior choice for acyclic queries (trees and paths) due to its aggressive caching and pruning mechanisms.
  • Geometric Pruning: Minesweeper's use of gap boxes enables the engine to skip millions of potential comparisons by identifying empty regions in the data space.
  • Attribute Ordering: Both algorithms are highly sensitive to the Global Attribute Order (GAO). Utilizing a Nested Elimination Order (NEO) was found to be critical for maintaining high performance.

Conclusion

This research demonstrates that a well-architected RDBMS can handle both traditional relational workloads and complex graph analytics effectively. By incorporating modern join algorithms, the "old dog" of relational technology can indeed learn "new tricks" to match or beat specialized graph engines. Future work will focus on automating attribute order selection and extending these techniques to recursive graph queries.

Summary updated

BibTeX
@inproceedings{nguyen2015join,
  author = {Dung T. Nguyen and Molham Aref and Martin Bravenboer and George Kollias and Hung Q. Ngo and Christopher Ré and Atri Rudra},
  title = {{Join Processing for Graph Patterns: An Old Dog with New Tricks}},
  booktitle = {GRADES@SIGMOD/PODS},
  year = {2015},
  doi = {10.1145/2764947.2764948},
}
Figure