Beyond Equi-joins: Ranking, Enumeration and Factorization

Nikolaos Tziavelis, Wolfgang Gatterbauer, Mirek Riedewald
1/28/2021
cs.DBcs.DS

Official code: northeastern-datalab/anyk-code (10 stars, Java, Apache-2.0, last commit 2024-04-10).

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 $n$ denoting the number of tuples in the database, we guarantee for acyclic full join queries with inequality conditions that for every value of $k$, the $k$ top-ranked answers are returned in $\mathcal{O}(n \operatorname{polylog} n + k \log k)$ time.

Show full abstract

This is within a polylogarithmic factor of $\mathcal{O}(n + k \log k)$, i.e., the best known complexity for equi-joins, and even of $\mathcal{O}(n+k)$, i.e., the time it takes to look at the input and return $k$ 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 $n^\ell$ for a join of $\ell$ relations. The key ingredient is a novel $\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.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
103Java, PythonMar 7, 20212 years agoApache-2.0

Similar Papers

Cite this paper

@article{tziavelis2021beyond,
  title  = {Beyond Equi-joins: Ranking, Enumeration and Factorization},
  author = {Nikolaos Tziavelis and Wolfgang Gatterbauer and Mirek Riedewald},
  year   = {2021},
  eprint = {2101.12158},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2101.12158}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2101.12158.svg)](https://codeofpaper.com/paper/2101.12158)

Discussion