Skip to main content
QUICK REVIEW

[论文解读] Beyond Equi-joins: Ranking, Enumeration and Factorization

Nikolaos Tziavelis, Wolfgang Gatterbauer|arXiv (Cornell University)|Jan 28, 2021
Game Theory and Voting Systems参考文献 65被引用 4
一句话总结

本论文提出了首个针对包含不等式条件的 theta-join 的排名枚举算法,具备坚实的理论保证,采用一种新颖的 O(n polylog n) 大小的因子化表示(TLFG),实现了高效且增量式的 top-k 结果检索。该算法在无环全连接场景下达到 O(n polylog n + k log k) 的时间复杂度——接近最优的 polylogarithmic 因子——即使输出大小为 n^ℓ 时亦然,且在实际应用中相比最先进 DBMS 系统性能高出数个数量级。

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. 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.

研究动机与目标

  • 解决 theta-join 中存在不等式条件时,排名枚举在时间和空间复杂度上缺乏理论保证的问题。
  • 设计一种算法,即使在中间或最终输出大小较大(例如 ℓ 个关系时为 n^ℓ)的情况下,也能以最小延迟增量式返回 top-k 结果。
  • 将因子化数据库表示方法从等值连接扩展至支持复杂谓词(包括不等式的合取与析取)下的排名枚举。
  • 即使在最坏情况的数据倾斜或大规模输出场景下,也能实现接近理论下界 O(n + k) 的性能。
  • 通过在真实和合成数据集上的大量实验,展示方法的实际效率和可扩展性。

提出的方法

  • 提出一种新颖的因子化表示方法——元组列表因子图(TLFG),通过共享范围和分区策略,紧凑地编码查询结果。
  • 采用二叉或多重分区方案,递归分解连接空间,从而实现高效的枚举与排序。
  • 利用共享范围抽象,利用不等式谓词中的传递性,减少冗余,提升因子化效率。
  • 采用基于优先队列的枚举策略,按排名顺序检索 top-k 结果,每个结果在预处理后可在 O(log k) 时间内生成。
  • 针对给定查询和数据库,动态构建 TLFG 表示,确保空间复杂度与 O(n polylog n) 成比例。
  • 通过相应调整因子化与枚举逻辑,支持选择操作和多种投影(如自由连接与多重集语义)。

实验结果

研究问题

  • RQ1我们能否在具有不等式谓词的无环全 theta-join 中,实现接近最优的 O(n polylog n + k log k) 时间复杂度?
  • RQ2我们能否设计一种因子化表示,支持复杂 theta-join 的高效排名枚举,同时将空间复杂度控制在 O(n) 的 polylogarithmic 因子范围内?
  • RQ3在真实工作负载中,该方法在查询规模、连接选择性和带状连接范围增加时的可扩展性如何?
  • RQ4该方法能否在性能上超越传统 DBMS,后者需先物化完整连接结果再应用 top-k 过滤?
  • RQ5将因子化表示扩展至一般 theta-join(超越等值连接)的理论与实际极限是什么?

主要发现

  • 所提方法在具有不等式条件的无环全 theta-join 中实现 O(n polylog n + k log k) 的时间复杂度,该复杂度与最优下界 O(n + k) 仅相差一个 polylogarithmic 因子。
  • TLFG 因子化表示动态构建,空间复杂度为 O(n polylog n),即使在 ℓ 个关系时输出大小为 n^ℓ 的情况下,也能实现高效访问。
  • 实验表明,该方法在运行时间上相比最先进商业及开源 DBMS(如 PostgreSQL)高出数个数量级,尤其在 k 较小时表现更优。
  • 在 RedditTitles 和 OceaniaBirds 数据集上的实验表明,方法在不同查询规模、带状连接范围和域大小下均表现出稳健性能,连续结果间延迟极低。
  • 该方法支持广泛的查询类型,包括带选择和自由连接投影的查询,在数据倾斜情况下仍保持强大的理论保证。
  • TLFG 抽象结构在处理析取式和复杂不等式谓词方面,普遍优于传统范围树和分区方法。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。