Leapfrog Triejoin:一种最坏情况下的最优连接算法
Leapfrog Triejoin: a worst-case optimal join algorithm
摘要:
近年来,连接算法取得了令人兴奋的发展。在2008年,Atserias,Grohe和Marx(以下简称AGM)证明了一个完整合取查询的最大结果大小的紧界,给定输入关系大小的约束。2012年,Ngo、Porat、R{é}和Rudra(以下简称NPRR)设计了一个最坏情况下运行时间与AGM边界成比例的连接算法。我们的商业数据库系统LogicBlox采用了一种新的连接算法,\emph{leapfrog triejoin},比较显着以及NPRR算法在初步的基准测试。这促使我们分析跳耦连接的复杂性。在本文中,我们建立了蛙跳triejoin也是最坏情况下的最佳,对数因子,在NPRR的意义。我们改进NPRR的结果证明,蛙跳triejoin实现最坏情况下的最优的细粒度类的数据库实例,如那些定义的约束投影基数。我们表明,NPRR是\emph{not}最坏情况下的最佳此类,给出一个反例,其中蛙跳triejoin运行在$O(n \log n)$时间相比,$Θ(n^{1.375})$时间为NPRR。实际上,蛙跳triejoin可以使用传统的数据结构(如B树)来实现,并自然地扩展到$\exists_1$查询。我们相信我们的算法提供了一个有用的除了现有的连接算法的工具箱,易于吸收,实现简单,并有一个简洁的最优性证明。
英文摘要:
Recent years have seen exciting developments in join algorithms. In 2008, Atserias, Grohe and Marx (henceforth AGM) proved a tight bound on the maximum result size of a full conjunctive query, given constraints on the input relation sizes. In 2012, Ngo, Porat, R{é} and Rudra (henceforth NPRR) devised a join algorithm with worst-case running time proportional to the AGM bound. Our commercial Datalog system LogicBlox employs a novel join algorithm, \emph{leapfrog triejoin}, which compared conspicuously well to the NPRR algorithm in preliminary benchmarks. This spurred us to analyze the complexity of leapfrog triejoin. In this paper we establish that leapfrog triejoin is also worst-case optimal, up to a log factor, in the sense of NPRR. We improve on the results of NPRR by proving that leapfrog triejoin achieves worst-case optimality for finer-grained classes of database instances, such as those defined by constraints on projection cardinalities. We show that NPRR is \emph{not} worst-case optimal for such classes, giving a counterexample where leapfrog triejoin runs in $O(n \log n)$ time, compared to $Θ(n^{1.375})$ time for NPRR. On a practical note, leapfrog triejoin can be implemented using conventional data structures such as B-trees, and extends naturally to $\exists_1$ queries. We believe our algorithm offers a useful addition to the existing toolbox of join algorithms, being easy to absorb, simple to implement, and having a concise optimality proof.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。