Lune

VLDB2022顶会

Cost-based or Learning-based? A Hybrid Query Optimizer for Query Plan Selection

Xiang Yu, Chengliang Chai, Guoliang Li, Jiabin Liu

摘要

Traditional cost-based optimizers are efficient and stable to generate optimal plans for simple SQL queries, but they may not generate high-quality plans for complicated queries. Thus learning-based optimizers have been proposed recently that can learn high-quality plans based on past experiences. However, learning-based optimizers cannot work well for dynamic workloads that have different distributions with training examples. In this paper, we propose a hybrid optimizer that adopts the advantages and avoids the shortcomings of these two types of optimizers, which first generates high-quality candidate plans from each type of optimizers and then selects the best plan from the candidates. There are two challenges. (1) How to generate high-quality candidates? We propose a hint-based candidate generation method that leverages the learning-based method to generate highly beneficial hints and then uses a cost-based method to supplement the hints to generate complete plans as candidates. (2) How to evaluate different candidate plans and select the best one? We propose an uncertainty-based optimal plan selection model, which predicts the execution time and the uncertainty for each plan. The uncertainty reflects the confidence of the execution time prediction. We select the plan using the uncertainty model. Experiment results on real datasets showed that our method outperformed the state-of-the-art baselines, and reduced the total latency by 25% and the tail latency by 65% compared to PostgreSQL.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • Sample-Efficient Cardinality Estimation Using Geometric Deep Learning 引用了 Deep Unsupervised Cardinality Estimation
  • Sample-Efficient Cardinality Estimation Using Geometric Deep Learning 引用了 An End-to-End Learning-based Cost Estimator
  • FASTgres: Making Learned Query Optimizer Hinting Effective 引用了 An End-to-End Learning-based Cost Estimator
  • FASTgres: Making Learned Query Optimizer Hinting Effective 引用了 Bao: Making Learned Query Optimization Practical
  • PilotScope: Steering Databases with Machine Learning Drivers 引用了 Eraser: Eliminating Performance Regression on Learned Query Optimizer
  • PilotScope: Steering Databases with Machine Learning Drivers 引用了 Bao: Making Learned Query Optimization Practical
  • Eraser: Eliminating Performance Regression on Learned Query Optimizer 引用了 An End-to-End Learning-based Cost Estimator
  • Eraser: Eliminating Performance Regression on Learned Query Optimizer 引用了 Bao: Making Learned Query Optimization Practical
  • 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
  • Learned Index: A Comprehensive Experimental Evaluation 引用了 Reinforcement Learning with Tree-LSTM for Join Order Selection
  • Bao: Making Learned Query Optimization Practical 引用了 Deep Unsupervised Cardinality Estimation
  • Bao: Making Learned Query Optimization Practical 引用了 An End-to-End Learning-based Cost Estimator
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper28

  1. Learned Index: A Comprehensive Experimental EvaluationZhaoyan Sun, Xuanhe Zhou, Guoliang LiVLDB 2023 · 87 次引用
  2. FASTgres: Making Learned Query Optimizer Hinting EffectiveLucas Woltmann, Jerome Thiessat, Claudio Hartmann, Dirk Habich 等VLDB 2023 · 40 次引用
  3. Sample-Efficient Cardinality Estimation Using Geometric Deep LearningSilvan Reiner, Michael GrossniklausVLDB 2024 · 20 次引用
  4. Eraser: Eliminating Performance Regression on Learned Query OptimizerLianggui Weng, Rong Zhu, Di Wu, Bolin Ding 等VLDB 2024 · 19 次引用
  5. PilotScope: Steering Databases with Machine Learning DriversRong Zhu, Lianggui Weng, Wenqing Wei, Di Wu 等VLDB 2024 · 18 次引用

它引用的 Paper17

  1. An End-to-End Learning-based Cost EstimatorJi Sun, Guoliang LiVLDB 2020 · 251 次引用
  2. Bao: Making Learned Query Optimization PracticalRyan Marcus, Parimarjan Negi, Hongzi Mao, Nesime Tatbul 等SIGMOD 2021 · 242 次引用
  3. Uncertainty Weighted Actor-Critic for Offline Reinforcement LearningYue Wu, Shuangfei Zhai, Nitish Srivastava, Joshua M. Susskind 等ICML 2021 · 223 次引用
  4. Deep Unsupervised Cardinality EstimationZongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu 等VLDB 2020 · 206 次引用
  5. Reinforcement Learning with Tree-LSTM for Join Order SelectionXiang Yu, Guoliang Li, Chengliang Chai, Nan TangICDE 2020 · 168 次引用

相关 Paper

  1. LLM4Hint: Leveraging Large Language Models for Hint Recommendation in Offline Query OptimizationSuchen Liu, Yang Lin, Yinjun Han, Jun GaoICDE 2026 · 1 次引用
  2. Lero: A Learning-to-Rank Query OptimizerRong Zhu, Wei Chen, Bolin Ding, Xingguang Chen 等VLDB 2023 · 102 次引用
  3. Lequa: A Learning-Based Query-Aware Framework for Selective Query OptimizationGuoneng Li, Pengfei Zheng, Ling Xu, Yan Li 等ICDE 2026
  4. Conformal Prediction for Verifiable Learned Query OptimizationHanwen Liu, Shashank Giridhara, Ibrahim SabekVLDB 2025 · 2 次引用
  5. Kepler: Robust Learning for Parametric Query OptimizationLyric Doshi, Vincent Zhuang, Gaurav Jain, Ryan Marcus 等SIGMOD 2023 · 35 次引用
黄昏的海面,两侧是细线勾勒的悬崖