Lune

VLDB2026Top-tier venue

Window Function Optimization: Co-Evaluation and Other Techniques

Daniel Lindner, Felix Naumann, Alberto Lerner

Abstract

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× faster, with larger tables yielding larger gains.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Builds on2

  1. These Rows Are Made for Sorting and That's Just What We'll DoLaurens Kuiper, Hannes MühleisenICDE 2023 · 6 citations
  2. Window Function Expression: Let the Self-join EnterRadim BacaVLDB 2024

Related papers

  1. Efficient Evaluation of Arbitrarily-Framed Holistic SQL Aggregates and Window FunctionsAdrian Vogelsgesang, Thomas Neumann, Viktor Leis, Alfons KemperSIGMOD 2022
  2. Building Advanced SQL Analytics From Low-Level Plan OperatorsAndré Kohn, Viktor Leis, Thomas NeumannSIGMOD 2021 · 13 citations
  3. PLAQUE: Automated Predicate Learning at Query TimeYiming Lin, Sharad MehrotraSIGMOD 2024 · 2 citations
  4. Factor Windows: Cost-based Query Rewriting for Optimizing Correlated Window AggregatesWentao Wu, Philip A. Bernstein, Alex Raizman, Christina PavlopoulouICDE 2022 · 4 citations
  5. Conjunctive Queries with ComparisonsQichen Wang, Ke YiSIGMOD 2022 · 13 citations
Dusk over the sea between two cliffs drawn in fine vertical lines