arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

窗口函数优化:协同评估及其他技术

Window Function Optimization: Co-Evaluation and Other Techniques

Daniel Lindner, Felix Naumann, Alberto Lerner

arXiv 2608.06043首次发表:更新:

AI 中文总结

针对现有窗口函数优化框架缺失导致的限制,提出帧分析、分区分析及协同评估技术,在开源SQL引擎中使部分查询提速最高40.7倍且无性能损失。

AI 中文摘要

窗口函数是现代SQL中表达力最强的特性之一,令人惊讶的是,关于其优化的研究相对较少。目前存在一些技术,例如在理想条件下将谓词下推到窗口中,但当这些条件稍有不满足时,已知的优化就不再适用。我们证明这些限制并非根本性的,而是由于缺少一个用于窗口函数优化的推理框架才持续存在。我们提供了这样一个框架,引入了我们称之为帧分析(Frame Analysis)、分区分析(Partition Analysis)以及一种名为协同评估(Co-Evaluation)的新执行策略的技术。这些技术阐明了优化可以应用的时机和方式。特别是,协同评估允许即使当谓词依赖于窗口函数的结果时也能进行早期评估。我们呈现了每种技术,并将结果整理为窗口函数的代数等价表。我们在一个开源引擎中测试了这些优化,结果显示它们从未损害性能,并且使某些常见查询的速度提升了高达40.7倍,使用更大的表时获得的提升更大。

英文摘要

Window functions are among the most expressive features of modern SQL. Surprisingly, relatively little has been written about their optimization. Some techniques exist, such as pushing predicates through a window under ideal conditions, but known optimizations no longer apply when those conditions are even slightly unmet. We show that these limitations are not fundamental, but persist because a reasoning framework for window function optimization has been missing. We provide such a framework, introducing techniques we call Frame Analysis, Partition Analysis, and a new execution strategy called Co-Evaluation. These clarify when and how optimizations can be applied. Co-Evaluation, in particular, allows early evaluation of predicates even when they depend on the window function's result. We present each technique and organize the results as a table of algebraic equivalences for window functions. We test these optimizations in an open-source engine, where they never hurt performance and make certain common queries up to 40.7 times faster, with larger tables yielding larger gains.

Journal refPVLDB, 19(11): 3525-3537, 2026

DOI:10.14778/3836663.3836706

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑