Are We Ready For Learned Cardinality Estimation?
Xiaoying Wang, Changbo Qu, Weiyuan Wu, Jiannan Wang, Qingqing Zhou
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 54 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Lero: A Learning-to-Rank Query Optimizer 引用了 FLAT: Fast, Lightweight and Accurate Method for Cardinality Estimation
- Lero: A Learning-to-Rank Query Optimizer 引用了 Deep Unsupervised Cardinality Estimation
- Lero: A Learning-to-Rank Query Optimizer 引用了 An End-to-End Learning-based Cost Estimator
- Lero: A Learning-to-Rank Query Optimizer 引用了 Reinforcement Learning with Tree-LSTM for Join Order Selection
- Lero: A Learning-to-Rank Query Optimizer 引用了 Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation
- Lero: A Learning-to-Rank Query Optimizer 引用了 NeuroCard: One Cardinality Estimator for All Tables
- Balsa: Learning a Query Optimizer Without Expert Demonstrations 引用了 Deep Unsupervised Cardinality Estimation
- Balsa: Learning a Query Optimizer Without Expert Demonstrations 引用了 An End-to-End Learning-based Cost Estimator
- Balsa: Learning a Query Optimizer Without Expert Demonstrations 引用了 NeuroCard: One Cardinality Estimator for All Tables
- FLAT: Fast, Lightweight and Accurate Method for Cardinality Estimation 引用了 NeuroCard: One Cardinality Estimator for All Tables
- An End-to-End Learning-based Cost Estimator 引用了 Reinforcement Learning with Tree-LSTM for Join Order Selection
- Reinforcement Learning with Tree-LSTM for Join Order Selection 引用了 An End-to-End Learning-based Cost Estimator
- Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation 引用了 Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
- Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation 引用了 FLAT: Fast, Lightweight and Accurate Method for Cardinality Estimation
- Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation 引用了 An End-to-End Learning-based Cost Estimator
- Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation 引用了 Flow-Loss: Learning Cardinality Estimates That Matter
- Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation 引用了 NeuroCard: One Cardinality Estimator for All Tables
- Flow-Loss: Learning Cardinality Estimates That Matter 引用了 Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
- Flow-Loss: Learning Cardinality Estimates That Matter 引用了 Deep Unsupervised Cardinality Estimation
- Flow-Loss: Learning Cardinality Estimates That Matter 引用了 An End-to-End Learning-based Cost Estimator
- Flow-Loss: Learning Cardinality Estimates That Matter 引用了 NeuroCard: One Cardinality Estimator for All Tables
- NeuroCard: One Cardinality Estimator for All Tables 引用了 Deep Unsupervised Cardinality Estimation
- NeuroCard: One Cardinality Estimator for All Tables 引用了 An End-to-End Learning-based Cost Estimator
引用它的顶会 Paper54
- Cardinality Estimation in DBMS: A Comprehensive Benchmark EvaluationYuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu 等VLDB 2022 · 169 次引用
- FLAT: Fast, Lightweight and Accurate Method for Cardinality EstimationRong Zhu, Ziniu Wu, Yuxing Han, Kai Zeng 等VLDB 2021 · 120 次引用
- Lero: A Learning-to-Rank Query OptimizerRong Zhu, Wei Chen, Bolin Ding, Xingguang Chen 等VLDB 2023 · 102 次引用
- Flow-Loss: Learning Cardinality Estimates That MatterParimarjan Negi, Ryan Marcus, Andreas Kipf, Hongzi Mao 等VLDB 2021 · 102 次引用
- Balsa: Learning a Query Optimizer Without Expert DemonstrationsZongheng Yang, Wei-Lin Chiang, Sifei Luan, Gautam Mittal 等SIGMOD 2022 · 99 次引用
它引用的 Paper9
- An End-to-End Learning-based Cost EstimatorJi Sun, Guoliang LiVLDB 2020 · 251 次引用
- Deep Unsupervised Cardinality EstimationZongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu 等VLDB 2020 · 206 次引用
- Reinforcement Learning with Tree-LSTM for Join Order SelectionXiang Yu, Guoliang Li, Chengliang Chai, Nan TangICDE 2020 · 168 次引用
- NeuroCard: One Cardinality Estimator for All TablesZongheng Yang, Amog Kamsetty, Sifei Luan, Eric Liang 等VLDB 2021 · 138 次引用
- Deep Learning Models for Selectivity Estimation of Multi-Attribute QueriesShohedul Hasan, Saravanan Thirumuruganathan, Jees Augustine, Nick Koudas 等SIGMOD 2020 · 101 次引用
相关 Paper
- Prediction Intervals for Learned Cardinality Estimation: An Experimental EvaluationSaravanan Thirumuruganathan, Suraj Shetiya, Nick Koudas, Gautam DasICDE 2022 · 7 次引用
- Learned Cardinality Estimation: An In-depth StudyKyoungmin Kim, Jisung Jung, In Seo, Wook-Shin Han 等SIGMOD 2022 · 51 次引用
- Theoretical Analysis of Learned Database Operations under Distribution Shift through Distribution LearnabilitySepanta Zeighami, Cyrus ShahabiICML 2024 · 5 次引用
- Learned Cardinality Estimation: A Design Space Exploration and A Comparative EvaluationJi Sun, Jintao Zhang, Zhaoyan Sun, Guoliang Li 等VLDB 2022 · 90 次引用
- Warper: Efficiently Adapting Learned Cardinality Estimators to Data and Workload DriftsBeibin Li, Yao Lu, Srikanth KandulaSIGMOD 2022 · 29 次引用
