arXivDaily arXiv每日学术速递 周一至周五更新
今晚才能更新了~~大家休息下再来吧
arXiv 2002.00540cs.DBcs.DS
收藏

面向列式引擎的含析取查询谓词优化

Optimizing Query Predicates with Disjunctions for Column-Oriented Engines

Albert Kim, Atalay Mert Ileri, Sam Madden

AI总结:

本研究针对列式引擎中含析取的谓词优化问题,提出多项式时间最优算法BestD/Update,结合Hanani算法得到实用的EvalPred算法,实验证明其性能显著优于现有方案。

摘要:

数据库研究领域对含析取的谓词优化的关注度一直较为有限。过往为数不多的相关研究大多聚焦于传统行式数据库的优化。然而,行式引擎与列式引擎在谓词计算方式上的一个关键区别在于:行式引擎每次对单个元组应用谓词,而列式引擎对元组集合应用谓词,这为该问题增加了新的维度。因此,行式引擎仅关注谓词的最佳应用顺序以实现整个谓词表达式的“短路”计算,但列式引擎还必须额外确定每次谓词应用的输入元组集合。这一点至关重要,因为更小的输入能带来更快的运行速度;同时该问题也颇具难度,因为较早应用的谓词的结果可用于缩减后续谓词的输入,且谓词可通过谓词表达式中的析取进行组合。在本研究中,我们对列式引擎的谓词计算问题进行了形式化分析,并提出了BestD/Update——这是有史以来首个能推导出每次谓词应用的最小输入集合的多项式时间、可证明最优的算法。BestD/Update的最优性在多种成本模型下均有保障,这些成本模型对应不同的实际应用场景。此外,当与谓词排序算法Hanani结合时,BestD/Update可简化为EvalPred,这是一种简单的O(n log² n)算法,我们推荐其用于实际应用,且该算法对所有嵌套深度不超过2的谓词表达式都是最优的。我们的评估表明,得益于其最优性和多项式级的规划时间,在合成工作负载下,EvalPred的性能分别比未实现任何析取优化的方案和现有最优算法高出最高2.6倍和28倍;在来自TPC-H和CH-benchmark的查询中,其性能分别高出最高1.3倍和100倍。

英文摘要:

Database research has always given limited attention to optimizing predicates with disjunctions. What little past work there is, has mostly focused on optimizations for traditional row-oriented databases. However, a key difference between how row-oriented and column-oriented engines evaluate predicates is that while row-oriented engines apply predicates to a single tuple at a time, column-oriented engines apply predicates to sets of tuples, adding another dimension to the problem. As such, row-oriented engines focus only on the best order to apply predicates in to "short-circuit" the overall predicate expression, but column-oriented engines must additionally decide on the input sets of tuples for each predicate application. This is important, since smaller inputs lead to faster runtimes, and nontrivial, since the results of earlier predicates can be used to reduce the inputs to later predicates and predicates may be combined via disjunctions in the predicate expression. In this work, we formally analyze the predicate evaluation problem for column-oriented engines and present BestD/Update, the first ever polynomial-time, provably optimal algorithms to deduce the minimum input sets for each predicate application. BestD/Update's optimality is guaranteed under a wide range of cost models, representing different real-world scenarios. Furthermore, when combined with the predicate ordering algorithm Hanani, BestD/Update reduce into EvalPred, a simple O(n log^2 n) algorithm, which we recommend for practical use and optimal for all predicate expressions of nested depth 2 or less. Our evaluation shows, thanks to its optimality and polynomial planning time, EvalPred outperforms not implementing any disjunction optimizations and exiting optimal algorithms by up to 2.6x and 28x respectively for synthetic workloads and by up to 1.3x and 100x respectively for queries from TPC-H and the CH-benchmark.

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

↑