English

Beyond Equi-joins: Ranking, Enumeration and Factorization

Databases 2021-08-31 v4 Data Structures and Algorithms

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 nn denoting the number of tuples in the database, we guarantee for acyclic full join queries with inequality conditions that for every value of kk, the kk top-ranked answers are returned in O(npolylogn+klogk)\mathcal{O}(n \operatorname{polylog} n + k \log k) time. This is within a polylogarithmic factor of O(n+klogk)\mathcal{O}(n + k \log k), i.e., the best known complexity for equi-joins, and even of O(n+k)\mathcal{O}(n+k), i.e., the time it takes to look at the input and return kk 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 nn^\ell for a join of \ell relations. The key ingredient is a novel O(npolylogn)\mathcal{O}(n \operatorname{polylog} n)-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 non-trivial 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.

Cite

@article{arxiv.2101.12158,
  title  = {Beyond Equi-joins: Ranking, Enumeration and Factorization},
  author = {Nikolaos Tziavelis and Wolfgang Gatterbauer and Mirek Riedewald},
  journal= {arXiv preprint arXiv:2101.12158},
  year   = {2021}
}

Comments

21 pages

R2 v1 2026-06-23T22:37:50.456Z