arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.04042cs.DB
收藏

实例最优的无遗憾无环连接处理:在列存储中工程化Yannakakis算法

Instance-Optimal Acyclic Join Processing Without Regret: Engineering the Yannakakis Algorithm in Column Stores

Liese Bekkers, Frank Neven, Stijn Vansummeren, Yisu Remy Wang

AI总结:

本文提出Shredded Yannakakis(SYA)算法,将二元连接计划转换为两阶段NSA计划,在列存储中实现无遗憾的实例最优无环连接处理,实验显示在85.3%的查询上加速最高达62.5倍。

摘要:

无环连接查询可以使用Yannakakis算法进行实例最优评估,该算法通过半连接传递避免了不必要的大型中间结果。最近的研究提出通过将哈希连接算子分解为两个子算子(称为Lookup和Expand)来解决朴素实现Yannakakis算法所带来的显著隐藏常数因子问题。在本文中,我们提出了一种在解释型环境(如列存储)中集成Lookup和Expand计划的新方法,使用嵌套半连接代数(NSA)对其进行形式化,并通过一种切碎(shredding)方法实现。我们将可以实例最优评估的NSA表达式类刻画为那些“两阶段”(2-phase)的表达式:即在unnest(即expand)之后不应用任何“收缩”(shrinking)算子。我们引入了Shredded Yannakakis(SYA),一种用于无环连接的评估算法,该算法从二元连接计划出发,将其转换为两阶段NSA计划,然后通过切碎技术进行评估。我们证明,在行为良好的二元连接计划类上,SYA是经得起验证的稳健的(即从不产生大型中间结果)且无遗憾的(即在合适的成本模型下,其性能从不劣于二元连接计划)。我们在包含1,849个查询的测试集上的实验表明,SYA在85.3%的查询上提升了性能,加速比最高达62.5倍,同时在其余查询上保持竞争力。我们希望这种方法能为Yannakakis算法提供新的视角,帮助系统工程师更好地理解其实际益处,并促进其被更广泛的查询引擎所采用。

英文摘要:

Acyclic join queries can be evaluated instance-optimally using Yannakakis' algorithm, which avoids needlessly large intermediate results through semi-join passes. Recent work proposes to address the significant hidden constant factors arising from a naive implementation of Yannakakis by decomposing the hash join operator into two suboperators, called Lookup and Expand. In this paper, we present a novel method for integrating Lookup and Expand plans in interpreted environments, like column stores, formalizing them using Nested Semijoin Algebra (NSA) and implementing them through a shredding approach. We characterize the class of NSA expressions that can be evaluated instance-optimally as those that are 2-phase: no `shrinking' operator is applied after an unnest (i.e., expand). We introduce Shredded Yannakakis (SYA), an evaluation algorithm for acyclic joins that, starting from a binary join plan, transforms it into a 2-phase NSA plan, and then evaluates it through the shredding technique. We show that SYA is provably robust (i.e., never produces large intermediate results) and without regret (i.e., is never worse than the binary join plan under a suitable cost model) on the class of well-behaved binary join plans. Our experiments on a suite of 1,849 queries show that SYA improves performance for 85.3% of the queries with speedups up to 62.5x, while remaining competitive on the other queries. We hope this approach offers a fresh perspective on Yannakakis' algorithm, helping system engineers better understand its practical benefits and facilitating its adoption into a broader spectrum of query engines.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑