Lune

VLDB2021顶会

Flow-Loss: Learning Cardinality Estimates That Matter

Parimarjan Negi, Ryan Marcus, Andreas Kipf, Hongzi Mao, Nesime Tatbul, Tim Kraska, Mohammad Alizadeh

摘要

Previous approaches to learned cardinality estimation have focused on improving average estimation error, but not all estimates matter equally. Since learned models inevitably make mistakes, the goal should be to improve the estimates that make the biggest difference to an optimizer. We introduce a new loss function, Flow-Loss, that explicitly optimizes for better query plans by approximating the optimizer's cost model and dynamic programming search algorithm with analytical functions. At the heart of Flow-Loss is a reduction of query optimization to a flow routing problem on a certain plan graph in which paths correspond to different query plans. To evaluate our approach, we introduce the Cardinality Estimation Benchmark (CEB) which contains the ground truth cardinalities for sub-plans of over 16K queries from 21 templates with up to 15 joins. We show that across different architectures and databases, a model trained with Flow-Loss improves the cost of plans (using the PostgreSQL cost model) and query runtimes despite having worse estimation accuracy than a model trained with Q-Error. When the test set queries closely match the training queries, both models improve performance significantly over PostgreSQL and are close to the optimal performance (using true cardinalities). However, the Q-Error trained model degrades significantly when evaluated on queries that are slightly different (e.g., similar but not identical query templates), while the Flow-Loss trained model generalizes better to such situations. For example, the Flow-Loss model achieves up to 1.5× better runtimes on unseen templates compared to the Q-Error model, despite leveraging the same model architecture and training data.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 52 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • FactorJoin: A New Cardinality Estimation Framework for Join Queries 引用了 Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
  • FactorJoin: A New Cardinality Estimation Framework for Join Queries 引用了 Fauce: Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation
  • FactorJoin: A New Cardinality Estimation Framework for Join Queries 引用了 An End-to-End Learning-based Cost Estimator
  • FactorJoin: A New Cardinality Estimation Framework for Join Queries 引用了 NeuroCard: One Cardinality Estimator for All Tables
  • Robust Query Driven Cardinality Estimation under Changing Workloads 引用了 FactorJoin: A New Cardinality Estimation Framework for Join Queries
  • Robust Query Driven Cardinality Estimation under Changing Workloads 引用了 Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
  • Robust Query Driven Cardinality Estimation under Changing Workloads 引用了 Are We Ready For Learned Cardinality Estimation?
  • Robust Query Driven Cardinality Estimation under Changing Workloads 引用了 Fauce: Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation
  • Robust Query Driven Cardinality Estimation under Changing Workloads 引用了 Learned Cardinality Estimation: An In-depth Study
  • Robust Query Driven Cardinality Estimation under Changing Workloads 引用了 Deep Unsupervised Cardinality Estimation
  • Robust Query Driven Cardinality Estimation under Changing Workloads 引用了 Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation
  • Robust Query Driven Cardinality Estimation under Changing Workloads 引用了 NeuroCard: One Cardinality Estimator for All Tables
  • Are We Ready For Learned Cardinality Estimation? 引用了 Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
  • Are We Ready For Learned Cardinality Estimation? 引用了 Deep Unsupervised Cardinality Estimation
  • Are We Ready For Learned Cardinality Estimation? 引用了 An End-to-End Learning-based Cost Estimator
  • Are We Ready For Learned Cardinality Estimation? 引用了 NeuroCard: One Cardinality Estimator for All Tables
  • Fauce: Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation 引用了 Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
  • Fauce: Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation 引用了 Are We Ready For Learned Cardinality Estimation?
  • Fauce: Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation 引用了 Deep Unsupervised Cardinality Estimation
  • Fauce: Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation 引用了 NeuroCard: One Cardinality Estimator for All Tables
  • Learned Cardinality Estimation: An In-depth Study 引用了 Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
  • Learned Cardinality Estimation: An In-depth Study 引用了 Are We Ready For Learned Cardinality Estimation?
  • Learned Cardinality Estimation: An In-depth Study 引用了 Fauce: Fast and Accurate Deep Ensembles with Uncertainty for Cardinality Estimation
  • Learned Cardinality Estimation: An In-depth Study 引用了 Deep Unsupervised Cardinality Estimation
  • Learned Cardinality Estimation: An In-depth Study 引用了 An End-to-End Learning-based Cost Estimator
  • Learned Cardinality Estimation: An In-depth Study 引用了 NeuroCard: One Cardinality Estimator for All Tables
  • 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 引用了 Are We Ready For Learned 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 引用了 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
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper52

  1. Cardinality Estimation in DBMS: A Comprehensive Benchmark EvaluationYuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu 等VLDB 2022 · 169 次引用
  2. Robust Query Driven Cardinality Estimation under Changing WorkloadsParimarjan Negi, Ziniu Wu, Andreas Kipf, Nesime Tatbul 等VLDB 2023 · 88 次引用
  3. Fauce: Fast and Accurate Deep Ensembles with Uncertainty for Cardinality EstimationJie Liu, Wenqian Dong, Dong Li, Qingqing ZhouVLDB 2021 · 71 次引用
  4. FactorJoin: A New Cardinality Estimation Framework for Join QueriesZiniu Wu, Parimarjan Negi, Mohammad Alizadeh, Tim Kraska 等SIGMOD 2023 · 54 次引用
  5. Learned Cardinality Estimation: An In-depth StudyKyoungmin Kim, Jisung Jung, In Seo, Wook-Shin Han 等SIGMOD 2022 · 51 次引用

它引用的 Paper7

  1. An End-to-End Learning-based Cost EstimatorJi Sun, Guoliang LiVLDB 2020 · 251 次引用
  2. Deep Unsupervised Cardinality EstimationZongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu 等VLDB 2020 · 206 次引用
  3. Are We Ready For Learned Cardinality Estimation?Xiaoying Wang, Changbo Qu, Weiyuan Wu, Jiannan Wang 等VLDB 2021 · 156 次引用
  4. NeuroCard: One Cardinality Estimator for All TablesZongheng Yang, Amog Kamsetty, Sifei Luan, Eric Liang 等VLDB 2021 · 138 次引用
  5. Deep Learning Models for Selectivity Estimation of Multi-Attribute QueriesShohedul Hasan, Saravanan Thirumuruganathan, Jees Augustine, Nick Koudas 等SIGMOD 2020 · 101 次引用

相关 Paper

  1. Sub-optimal Join Order Identification with L1-errorYesdaulet Izenov, Asoke Datta, Brian Tsan, Florin RusuSIGMOD 2024 · 1 次引用
  2. Speeding Up End-to-end Query Execution via Learning-based Progressive Cardinality EstimationFang Wang, Xiao Yan, Man Lung Yiu, Shuai Li 等SIGMOD 2023 · 24 次引用
  3. Sample-Efficient Cardinality Estimation Using Geometric Deep LearningSilvan Reiner, Michael GrossniklausVLDB 2024 · 20 次引用
  4. LpBound: Pessimistic Cardinality Estimation Using ℓp-Norms of Degree SequencesHaozhe Zhang, Christoph Mayer, Mahmoud Abo Khamis, Dan Olteanu 等SIGMOD 2025 · 7 次引用
  5. Warper: Efficiently Adapting Learned Cardinality Estimators to Data and Workload DriftsBeibin Li, Yao Lu, Srikanth KandulaSIGMOD 2022 · 29 次引用
黄昏的海面,两侧是细线勾勒的悬崖