Lune

VLDB2021Top-tier venue

Are We Ready For Learned Cardinality Estimation?

Xiaoying Wang, Changbo Qu, Weiyuan Wu, Jiannan Wang, Qingqing Zhou

Abstract

Cardinality estimation is a fundamental but long unresolved problem in query optimization. Recently, multiple papers from different research groups consistently report that learned models have the potential to replace existing cardinality estimators. In this paper, we ask a forward-thinking question: Are we ready to deploy these learned cardinality models in production? Our study consists of three main parts. Firstly, we focus on the static environment (i.e., no data updates) and compare five new learned methods with eight traditional methods on four real-world datasets under a unified workload setting. The results show that learned models are indeed more accurate than traditional methods, but they often suffer from high training and inference costs. Secondly, we explore whether these learned models are ready for dynamic environments (i.e., frequent data updates). We find that they cannot catch up with fast data up-dates and return large errors for different reasons. For less frequent updates, they can perform better but there is no clear winner among themselves. Thirdly, we take a deeper look into learned models and explore when they may go wrong. Our results show that the performance of learned methods can be greatly affected by the changes in correlation, skewness, or domain size. More importantly, their behaviors are much harder to interpret and often unpredictable. Based on these findings, we identify two promising research directions (control the cost of learned models and make learned models trustworthy) and suggest a number of research opportunities. We hope that our study can guide researchers and practitioners to work together to eventually push learned cardinality estimators into real database systems.

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.

54 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

  • Lero: A Learning-to-Rank Query Optimizer cites FLAT: Fast, Lightweight and Accurate Method for Cardinality Estimation
  • Lero: A Learning-to-Rank Query Optimizer cites Deep Unsupervised Cardinality Estimation
  • Lero: A Learning-to-Rank Query Optimizer cites An End-to-End Learning-based Cost Estimator
  • Lero: A Learning-to-Rank Query Optimizer cites Reinforcement Learning with Tree-LSTM for Join Order Selection
  • Lero: A Learning-to-Rank Query Optimizer cites Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation
  • Lero: A Learning-to-Rank Query Optimizer cites NeuroCard: One Cardinality Estimator for All Tables
  • Balsa: Learning a Query Optimizer Without Expert Demonstrations cites Deep Unsupervised Cardinality Estimation
  • Balsa: Learning a Query Optimizer Without Expert Demonstrations cites An End-to-End Learning-based Cost Estimator
  • Balsa: Learning a Query Optimizer Without Expert Demonstrations cites NeuroCard: One Cardinality Estimator for All Tables
  • FLAT: Fast, Lightweight and Accurate Method for Cardinality Estimation cites NeuroCard: One Cardinality Estimator for All Tables
  • An End-to-End Learning-based Cost Estimator cites Reinforcement Learning with Tree-LSTM for Join Order Selection
  • Reinforcement Learning with Tree-LSTM for Join Order Selection cites An End-to-End Learning-based Cost Estimator
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites FLAT: Fast, Lightweight and Accurate Method for Cardinality Estimation
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites An End-to-End Learning-based Cost Estimator
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites Flow-Loss: Learning Cardinality Estimates That Matter
  • Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites NeuroCard: One Cardinality Estimator for All Tables
  • Flow-Loss: Learning Cardinality Estimates That Matter cites Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
  • Flow-Loss: Learning Cardinality Estimates That Matter cites Deep Unsupervised Cardinality Estimation
  • Flow-Loss: Learning Cardinality Estimates That Matter cites An End-to-End Learning-based Cost Estimator
  • Flow-Loss: Learning Cardinality Estimates That Matter cites NeuroCard: One Cardinality Estimator for All Tables
  • NeuroCard: One Cardinality Estimator for All Tables cites Deep Unsupervised Cardinality Estimation
  • NeuroCard: One Cardinality Estimator for All Tables cites An End-to-End Learning-based Cost Estimator
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers54

  1. Cardinality Estimation in DBMS: A Comprehensive Benchmark EvaluationYuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu et al.VLDB 2022 · 169 citations
  2. FLAT: Fast, Lightweight and Accurate Method for Cardinality EstimationRong Zhu, Ziniu Wu, Yuxing Han, Kai Zeng et al.VLDB 2021 · 120 citations
  3. Lero: A Learning-to-Rank Query OptimizerRong Zhu, Wei Chen, Bolin Ding, Xingguang Chen et al.VLDB 2023 · 102 citations
  4. Flow-Loss: Learning Cardinality Estimates That MatterParimarjan Negi, Ryan Marcus, Andreas Kipf, Hongzi Mao et al.VLDB 2021 · 102 citations
  5. Balsa: Learning a Query Optimizer Without Expert DemonstrationsZongheng Yang, Wei-Lin Chiang, Sifei Luan, Gautam Mittal et al.SIGMOD 2022 · 99 citations

Builds on9

  1. An End-to-End Learning-based Cost EstimatorJi Sun, Guoliang LiVLDB 2020 · 251 citations
  2. Deep Unsupervised Cardinality EstimationZongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu et al.VLDB 2020 · 206 citations
  3. Reinforcement Learning with Tree-LSTM for Join Order SelectionXiang Yu, Guoliang Li, Chengliang Chai, Nan TangICDE 2020 · 168 citations
  4. NeuroCard: One Cardinality Estimator for All TablesZongheng Yang, Amog Kamsetty, Sifei Luan, Eric Liang et al.VLDB 2021 · 138 citations
  5. Deep Learning Models for Selectivity Estimation of Multi-Attribute QueriesShohedul Hasan, Saravanan Thirumuruganathan, Jees Augustine, Nick Koudas et al.SIGMOD 2020 · 101 citations

Related papers

  1. Prediction Intervals for Learned Cardinality Estimation: An Experimental EvaluationSaravanan Thirumuruganathan, Suraj Shetiya, Nick Koudas, Gautam DasICDE 2022 · 7 citations
  2. Learned Cardinality Estimation: An In-depth StudyKyoungmin Kim, Jisung Jung, In Seo, Wook-Shin Han et al.SIGMOD 2022 · 51 citations
  3. Theoretical Analysis of Learned Database Operations under Distribution Shift through Distribution LearnabilitySepanta Zeighami, Cyrus ShahabiICML 2024 · 5 citations
  4. Learned Cardinality Estimation: A Design Space Exploration and A Comparative EvaluationJi Sun, Jintao Zhang, Zhaoyan Sun, Guoliang Li et al.VLDB 2022 · 90 citations
  5. Warper: Efficiently Adapting Learned Cardinality Estimators to Data and Workload DriftsBeibin Li, Yao Lu, Srikanth KandulaSIGMOD 2022 · 29 citations
Dusk over the sea between two cliffs drawn in fine vertical lines