[Experiment, Analysis, and Benchmark] Systematic Evaluation of Plan-based Adaptive Query Processing
Pei Mu, Anderson Chaves Carniel, Antonio Barbalace, Amir Shaikhha
TL;DR
The paper tackles the persistent problem of unreliable cardinality estimation in DBMSs by systematically evaluating plan-based Adaptive Query Processing (AQP) across on-disk PostgreSQL and in-memory DuckDB. It proposes a unified, modular design to isolate and quantify the contributions of monitors, plan splitters, and sub-plan selectors, implementing these in both PostgreSQL (AQP-PostgreSQL) and DuckDB (AQP-DuckDB). The experimental results reveal that on-disk systems primarily gain from plan reorderings, while in-memory systems benefit mainly from cardinality refinement, with plan-based AQP outperforming relation-based AQP on complex multi-join workloads. These insights provide practical guidance for researchers and database engineers on when and how to apply plan-based AQP, and highlight avenues for improving split-point decision-making and executor co-design to maximize performance gains.
Abstract
Unreliable cardinality estimation remains a critical performance bottleneck in database management systems (DBMSs). Adaptive Query Processing (AQP) strategies address this limitation by providing a more robust query execution mechanism. Specifically, plan-based AQP achieves this by incrementally refining cardinality using feedback from the execution of sub-plans. However, the actual reason behind the improvements of plan-based AQP, especially across different storage architectures (on-disk vs. in-memory DBMSs), remains unexplored. This paper presents the first comprehensive analysis of state-of-the-art plan-based AQP. We implement and evaluate this strategy on both on-disk and in-memory DBMSs across two benchmarks. Our key findings reveal that while plan-based AQP provides overall speedups in both environments, the sources of improvement differ significantly. In the on-disk DBMS, PostgreSQL, performance gains primarily come from the query plan reorderings, but not the cardinality updating mechanism; in fact, updating cardinalities introduces measurable overhead. Conversely, in the in-memory DBMS, DuckDB, cardinality refinement drives significant performance improvements for most queries. We also observe significant performance benefits of the plan-based AQP compared to a state-of-the-art related-based AQP method. These observations provide crucial insights for researchers on when and why plan-based AQP is effective, and ultimately guide database system developers on the tradeoffs between the implementation effort and performance improvements.
