Beyond Equi-joins: Ranking, Enumeration and Factorization
Nikolaos Tziavelis, Wolfgang Gatterbauer, Mirek Riedewald
Abstract
We study theta-joins in general and join predicates with conjunctions and disjunctions of inequalities in particular, focusing on ranked enumeration where the answers are returned incrementally in an order dictated by a given ranking function. Our approach achieves strong time and space complexity properties: with ๐ denoting the number of tuples in the database, we guarantee for acyclic full join queries with inequality conditions that for every value of ๐, the ๐ top-ranked answers are returned in O (๐ polylog ๐ + ๐ log ๐) time. This is within a polylogarithmic factor of O (๐ + ๐ log ๐), i.e., the best known complexity for equi-joins, and even of O (๐ + ๐), i.e., the time it takes to look at the input and return ๐ answers in any order. Our guarantees extend to join queries with selections and many types of projections (namely those called "free-connex" queries and those that use bag semantics). Remarkably, they hold even when the number of join results is ๐ โ for a join of โ relations. The key ingredient is a novel O (๐ polylog ๐)-size factorized representation of the query output, which is constructed on-the-fly for a given query and database. In addition to providing the first nontrivial theoretical guarantees beyond equi-joins, we show in an experimental study that our ranked-enumeration approach is also memory-efficient and fast in practice, beating the running time of state-of-the-art database systems by orders of magnitude.
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.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 0498691f-a39c-4992-b05d-68870f692d1aCited by top-tier papers6
- Ranked Enumeration of Join Queries with ProjectionsShaleen Deep, Xiao Hu, Paraschos KoutrisVLDB 2022 ยท 14 citations
- Conjunctive Queries with ComparisonsQichen Wang, Ke YiSIGMOD 2022 ยท 13 citations
- Optimizing Queries with Many-to-Many JoinsHasara Kalumin, Amol DeshpandeICDE 2025 ยท 3 citations
- Worst-Case-Optimal Similarity Joins on Graph DatabasesDiego Arroyuelo, Benjamin Bustos, Adriรกn Gรณmez-Brandรณn, Aidan Hogan et al.SIGMOD 2024 ยท 3 citations
- Synthesizing Scoring Functions for Rankings Using Symbolic Gradient DescentZixuan Chen, Panagiotis Manolios, Mirek RiedewaldICDE 2025 ยท 2 citations
Builds on3
- Optimal Algorithms for Ranked Enumeration of Answers to Full Conjunctive QueriesNikolaos Tziavelis, Deepak Ajwani, Wolfgang Gatterbauer, Mirek Riedewald et al.VLDB 2020 ยท 45 citations
- Near-Optimal Distributed Band-Joins through Recursive PartitioningRundong Li, Wolfgang Gatterbauer, Mirek RiedewaldSIGMOD 2020 ยท 8 citations
- Factorized Graph Representations for Semi-Supervised Learning from Sparse DataKrishna Kumar P., Paul Langton, Wolfgang GatterbauerSIGMOD 2020 ยท 4 citations
Related papers
- Towards Efficient Random-Order Enumeration for Join QueriesPengyu Chen, Zizheng Guo, Jianwei Yang, Dongjing MiaoVLDB 2026
- Succinct Structure Representations for Efficient Query OptimizationZhekai Jiang, Qichen Wang, Christoph KochSIGMOD 2026
- A Scalable and Generic Approach to Range JoinsMaximilian Reif, Thomas NeumannVLDB 2022 ยท 6 citations
- Query Optimization for Database-Returning QueriesSimon Rink, Jens DittrichSIGMOD 2026 ยท 1 citation
- The Data World Is Not Flat: Efficient Factorized Execution for Relational SystemsStefan Lehner, Thomas NeumannVLDB 2026
