Practical Parameterized Query Optimization via Efficient Plan Reuse and List-wise Ranking
Hai Lan, Yang Yu, Zhifeng Bao, Zi Huang, Yuwei Peng
Abstract
Modern analytical workloads, particularly those powering business intelligence dashboards, are dominated by parameterized queries, where a small number of query templates are executed repeatedly with varying predicate values. Classical cost-based optimizers frequently fail to produce efficient execution plans in this setting due to inaccurate cardinality estimation and unstable plan choices. Although numerous learning-based optimizers have been proposed, most are designed for general, ad-hoc query optimization and overlook the repetitive structure of parameterized workloads. As a result, they often incur high training or serving overheads or require substantial modifications to existing database systems, limiting their practical adoption. We propose PLARQ, a practical learned optimizer tailored for Parameterized Query Optimization (PQO). We begin by analyzing existing approaches through a unified two-stage framework: (1) Plan Candidate Generation (PCG), which forms a set of plausible execution plans, and (2) Plan Ranking (PR), which selects the most promising one. This abstraction captures the core design principles of prior work and provides a foundation for systematic comparison. Building on this framework, PLARQ employs a similarity-based PCG approach to retrieve a compact, high-quality set of plan candidates from a precomputed plan pool, and a list-wise, attention-based ranking model to effectively identify the optimal plan among them. PLARQ integrates seamlessly with PostgreSQL without modifying the optimizer internals. Extensive experiments across five benchmarks demonstrate that PLARQ improves end-to-end query performance, achieving speedups of up to 420.31x over PostgreSQL and up to 2x over existing learned methods.
Ask Lune
Know where this paper stands in minutes, not an afternoon.
Lune can read the top-tier papers that cite it and the ones closest to it, and tells you what it claims, what came after and where it falls short, each point cited to the paper it comes from. No skimming, no AI slop.
Related papers
- RankPQO: Learning-to-Rank for Parametric Query OptimizationSongsong Mo, Yue Zhao, Zhifeng Bao, Quanqing Xu et al.VLDB 2025 · 3 citations
- Lero: A Learning-to-Rank Query OptimizerRong Zhu, Wei Chen, Bolin Ding, Xingguang Chen et al.VLDB 2023 · 102 citations
- LEAP: A Low-cost Spark SQL Query Optimizer using Pairwise ComparisonJunhao Ye, Jiahui Li, Lu Chen, Yuren Mao et al.VLDB 2025 · 2 citations
- APQO: An Adaptive Framework for Parametric Query OptimizationSijia Li, Peng Cai, Zhifan Zhang, Huiqi Hu et al.SIGMOD 2026 · 2 citations
- Lequa: A Learning-Based Query-Aware Framework for Selective Query OptimizationGuoneng Li, Pengfei Zheng, Ling Xu, Yan Li et al.ICDE 2026
