通过解耦非相关谓词加速 SQL 子查询(扩展版)
Speeding up SQL subqueries via decoupling of non-correlated predicate (extended version)
AI总结:
本文提出一种通过解耦相关子查询中非相关谓词来减少相关部分求值次数的技术,并在列存储和PostgreSQL上验证了在合适条件下可达5倍性能提升。
摘要:
本文讨论了一种处理 SQL 中相关子查询的新技术。核心思想是隔离谓词中的非相关部分,并利用它来减少相关部分的求值次数。我们首先概述了几类可能受益于该技术的查询。对于每一类查询,我们提出了一个潜在的改写方案,并讨论了其适用条件。接下来,我们讨论了所提出改写的求值方面:1) 我们描述了如何调整基于块的 Volcano 查询处理模型,2) 我们讨论了在支持延迟物化的位置启用列存储中实现该技术的好处。最后,我们提出了一个简单的成本模型,用于估计上述改写的收益。我们的评估包括定量部分和定性部分。前者侧重于研究非相关谓词选择性对我们技术的影响。后者通过将我们的方法与现有系统中可用的替代方法进行比较,指出了我们方法的局限性。总体而言,使用 PosDB(一个位置启用的列存储)和 PostgreSQL 进行的实验表明,在合适的条件下,我们的技术可以实现 5 倍的提升。
英文摘要:
In this paper, we discuss a novel technique for processing correlated subqueries in SQL. The core idea is to isolate the non-correlated part of the predicate and use it to reduce the number of evaluations of the correlated part. We begin by providing an overview of several classes of queries that may benefit from this technique. For each class, we propose a potential rewrite and discuss the conditions under which it is advantageous. Next, we address the evaluation aspects of the proposed rewrites: 1) we describe our approach to adapting the block-based Volcano query processing model, and 2) we discuss the benefits of implementing that technique within a position-enabled column-store with late materialization support. Finally, we present a simple cost model that allows estimation of the benefits of said rewrites. Our evaluation has a quantitative part and a qualitative part. The former focuses on studying the impact of non-correlated predicate selectivity on our technique. The latter identifies the limitations of our approach by comparing it with alternative approaches available in existing systems. Overall, experiments conducted using PosDB (a position-enabled column-store) and PostgreSQL demonstrated that, under suitable conditions, our technique can achieve a 5x improvement.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。