HackerPapers

arXiv:1203.1952cs.DB

Worst-case Optimal Join Algorithms

Hung Q. Ngo, Ely Porat, Christopher Ré, Atri Rudra

Abstract

Efficient join processing is one of the most fundamental and well-studied tasks in database research. In this work, we examine algorithms for natural join queries over many relations and describe a novel algorithm to process these queries optimally in terms of worst-case data complexity. Our result builds on recent work by Atserias, Grohe, and Marx, who gave bounds on the size of a full conjunctive query in terms of the sizes of the individual relations in the body of the query. These bounds, however, are not constructive: they rely on Shearer's entropy inequality which is information-theoretic. Thus, the previous results leave open the question of whether there exist algorithms whose running time achieve these optimal bounds. An answer to this question may be interesting to database practice, as it is known that any algorithm based on the traditional select-project-join style plans typically employed in an RDBMS are asymptotically slower than the optimal for some queries. We construct an algorithm whose running time is worst-case optimal for all natural join queries. Our result may be of independent interest, as our algorithm also yields a constructive proof of the general fractional cover bound by Atserias, Grohe, and Marx without using Shearer's inequality. This bound implies two famous inequalities in geometry: the Loomis-Whitney inequality and the Bollobás-Thomason inequality. Hence, our results algorithmically prove these inequalities as well. Finally, we discuss how our algorithm can be used to compute a relaxed notion of joins.

arXiv comments
Journal reference
DOI
Subjects
cs.DBDatabases cs.DSData Structures and Algorithms math.COCombinatorics

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Apr 2015 to Jan 2021.

Comments linking this paper, per year.

Discussed in comments2 threads

  1. Ordered Key-Value Stores 1 comment
    • It's all about efficient range reads and seek operations. You can compute set operations pretty efficiently using sorted indices that support a "find next or greater" operation. For intersection, take the first value from the first set as the smallest candidate of the output…

      j-pbView on HNParent context

    • Related (Referenced in the article): http://arxiv.org/abs/1203.1952 Chris Ré covers this in his CS345 course at Stanford.

      batbombView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.