Lune

VLDB2023Top-tier venue

Robust Query Driven Cardinality Estimation under Changing Workloads

Parimarjan Negi, Ziniu Wu, Andreas Kipf, Nesime Tatbul, Ryan Marcus, Sam Madden, Tim Kraska, Mohammad Alizadeh

Abstract

Query driven cardinality estimation models learn from a historical log of queries. They are lightweight, having low storage requirements, fast inference and training, and are easily adaptable for any kind of query. Unfortunately, such models can suffer unpredictably bad performance under workload drift, i.e., if the query pattern or data changes. This makes them unreliable and hard to deploy. We analyze the reasons why models become unpredictable due to workload drift, and introduce modifications to the query representation and neural network training techniques to make query-driven models robust to the effects of workload drift. First, we emulate workload drift in queries involving some unseen tables or columns by randomly masking out some table or column features during training. This forces the model to make predictions with missing query information, relying more on robust features based on up-to-date DBMS statistics that are useful even when query or data drift happens. Second, we introduce join bitmaps, which extends sampling-based features to be consistent across joins using ideas from sideways information passing. Finally, we show how both of these ideas can be adapted to handle data updates.

We show significantly greater generalization than past works across different workloads and databases. For instance, a model trained with our techniques on a simple workload (JOBLight-train), with 40 k synthetically generated queries of at most 3 tables each, is able to generalize to the much more complex Join Order Benchmark, which include queries with up to 16 tables, and improve query runtimes by 2× over PostgreSQL. We show similar robustness results with data updates, and across other workloads. We discuss the situations where we expect, and see, improvements, as well as more challenging workload drift scenarios where these techniques do not improve much over PostgreSQL. However, even in the most challenging scenarios, our models never perform worse than PostgreSQL, while standard query driven models can get much worse than PostgreSQL.

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.

32 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • The Holon Approach for Simultaneously Tuning Multiple Components in a Self-Driving Database Management System with Machine Learning via Synthesized Proto-Actions cites DeepDB: Learn from Data, not from Queries!
  • The Holon Approach for Simultaneously Tuning Multiple Components in a Self-Driving Database Management System with Machine Learning via Synthesized Proto-Actions cites Bao: Making Learned Query Optimization Practical
  • PRICE: A Pretrained Model for Cross-Database Cardinality Estimation cites Are We Ready For Learned Cardinality Estimation?
  • PRICE: A Pretrained Model for Cross-Database Cardinality Estimation cites ALECE: An Attention-based Learned Cardinality Estimator for SPJ Queries on Dynamic Workloads
  • PRICE: A Pretrained Model for Cross-Database Cardinality Estimation cites Deep Unsupervised Cardinality Estimation
  • Sample-Efficient Cardinality Estimation Using Geometric Deep Learning cites Are We Ready For Learned Cardinality Estimation?
  • Sample-Efficient Cardinality Estimation Using Geometric Deep Learning cites DeepDB: Learn from Data, not from Queries!
  • Sample-Efficient Cardinality Estimation Using Geometric Deep Learning cites Deep Unsupervised Cardinality Estimation
  • Sample-Efficient Cardinality Estimation Using Geometric Deep Learning cites Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation
  • Are We Ready For Learned Cardinality Estimation? cites Deep Unsupervised Cardinality Estimation
  • ALECE: An Attention-based Learned Cardinality Estimator for SPJ Queries on Dynamic Workloads cites Are We Ready For Learned Cardinality Estimation?
  • ALECE: An Attention-based Learned Cardinality Estimator for SPJ Queries on Dynamic Workloads cites Deep Unsupervised Cardinality Estimation
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites Are We Ready For Learned Cardinality Estimation?
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites DeepDB: Learn from Data, not from Queries!
  • Bao: Making Learned Query Optimization Practical cites Deep Unsupervised Cardinality Estimation
  • Breaking It Down: An In-depth Study of Index Advisors cites Are We Ready For Learned Cardinality Estimation?
  • Breaking It Down: An In-depth Study of Index Advisors cites Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers32

  1. ALECE: An Attention-based Learned Cardinality Estimator for SPJ Queries on Dynamic WorkloadsPengfei Li, Wenqing Wei, Rong Zhu, Bolin Ding et al.VLDB 2024 · 50 citations
  2. Breaking It Down: An In-depth Study of Index AdvisorsWei Zhou, Chen Lin, Xuanhe Zhou, Guoliang LiVLDB 2024 · 21 citations
  3. Sample-Efficient Cardinality Estimation Using Geometric Deep LearningSilvan Reiner, Michael GrossniklausVLDB 2024 · 20 citations
  4. PRICE: A Pretrained Model for Cross-Database Cardinality EstimationTianjing Zeng, Junwei Lan, Jiahong Ma, Wenqing Wei et al.VLDB 2025 · 14 citations
  5. The Holon Approach for Simultaneously Tuning Multiple Components in a Self-Driving Database Management System with Machine Learning via Synthesized Proto-ActionsWilliam Zhang, Wan Shen Lim, Matthew Butrovich, Andrew PavloVLDB 2024 · 13 citations

Builds on17

  1. Bao: Making Learned Query Optimization PracticalRyan Marcus, Parimarjan Negi, Hongzi Mao, Nesime Tatbul et al.SIGMOD 2021 · 242 citations
  2. Deep Unsupervised Cardinality EstimationZongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu et al.VLDB 2020 · 206 citations
  3. Cardinality Estimation in DBMS: A Comprehensive Benchmark EvaluationYuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu et al.VLDB 2022 · 169 citations
  4. Are We Ready For Learned Cardinality Estimation?Xiaoying Wang, Changbo Qu, Weiyuan Wu, Jiannan Wang et al.VLDB 2021 · 156 citations
  5. DeepDB: Learn from Data, not from Queries!Benjamin Hilprecht, Andreas Schmidt, Moritz Kulessa, Alejandro Molina et al.VLDB 2020 · 154 citations

Related papers

  1. Are Learned DBMS Components Robust to Workload Drift?: [Experiments & Analysis]Zizhong Meng, Gao Cong, Siqiang LuoSIGMOD 2026
  2. Warper: Efficiently Adapting Learned Cardinality Estimators to Data and Workload DriftsBeibin Li, Yao Lu, Srikanth KandulaSIGMOD 2022 · 29 citations
  3. Data-Agnostic Cardinality Learning from Imperfect WorkloadsPeizhi Wu, Rong Kang, Tieying Zhang, Jianjun Chen et al.VLDB 2025 · 1 citation
  4. Duet: Efficient and Scalable Hybrid Neural Relation UnderstandingKaixin Zhang, Hongzhi Wang, Yabin Lu, Ziqi Li et al.ICDE 2024 · 3 citations
  5. NeuroCard: One Cardinality Estimator for All TablesZongheng Yang, Amog Kamsetty, Sifei Luan, Eric Liang et al.VLDB 2021 · 138 citations
Dusk over the sea between two cliffs drawn in fine vertical lines