Lune

Abstract

Query optimization remains one of the most challenging problems in data management systems. Recent efforts to apply machine learning techniques to query optimization challenges have been promising, but have shown few practical gains due to substantive training overhead, inability to adapt to changes, and poor tail performance. Motivated by these difficulties and drawing upon a long history of research in multi-armed bandits, we introduce Bao (the Bandit optimizer). Bao takes advantage of the wisdom built into existing query optimizers by providing per-query optimization hints. Bao combines modern tree convolutional neural networks with Thompson sampling, a decades-old and well-studied reinforcement learning algorithm. As a result, Bao automatically learns from its mistakes and adapts to changes in query workloads, data, and schema. Experimentally, we demonstrate that Bao can quickly (an order of magnitude faster than previous approaches) learn strategies that improve end-to-end query execution performance, including tail latency. In cloud environments, we show that Bao can offer both reduced costs and better performance compared with a sophisticated commercial system.

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.

95 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 Deep Unsupervised Cardinality Estimation
  • Lero: A Learning-to-Rank Query Optimizer cites An End-to-End Learning-based Cost Estimator
  • Zero-Shot Cost Models for Out-of-the-box Learned Cost Prediction cites An End-to-End Learning-based Cost Estimator
  • Robust Query Driven Cardinality Estimation under Changing Workloads cites Deep Unsupervised Cardinality Estimation
  • Robust Query Driven Cardinality Estimation under Changing Workloads cites QuickSel: Quick Selectivity Learning with Mixture Models
  • QueryFormer: A Tree Transformer Model for Query Plan Representation cites QuickSel: Quick Selectivity Learning with Mixture Models
  • QueryFormer: A Tree Transformer Model for Query Plan Representation cites An End-to-End Learning-based Cost Estimator
  • 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
  • Deep Unsupervised Cardinality Estimation cites QuickSel: Quick Selectivity Learning with Mixture Models
  • QuickSel: Quick Selectivity Learning with Mixture Models cites Deep Unsupervised Cardinality Estimation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers95

  1. QueryFormer: A Tree Transformer Model for Query Plan RepresentationYue Zhao, Gao Cong, Jiachen Shi, Chunyan MiaoVLDB 2022 · 117 citations
  2. Lero: A Learning-to-Rank Query OptimizerRong Zhu, Wei Chen, Bolin Ding, Xingguang Chen et al.VLDB 2023 · 102 citations
  3. Balsa: Learning a Query Optimizer Without Expert DemonstrationsZongheng Yang, Wei-Lin Chiang, Sifei Luan, Gautam Mittal et al.SIGMOD 2022 · 99 citations
  4. Zero-Shot Cost Models for Out-of-the-box Learned Cost PredictionBenjamin Hilprecht, Carsten BinnigVLDB 2022 · 90 citations
  5. Robust Query Driven Cardinality Estimation under Changing WorkloadsParimarjan Negi, Ziniu Wu, Andreas Kipf, Nesime Tatbul et al.VLDB 2023 · 88 citations

Builds on3

  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. QuickSel: Quick Selectivity Learning with Mixture ModelsYongjoo Park, Shucheng Zhong, Barzan MozafariSIGMOD 2020 · 66 citations

Related papers

  1. Bayesian Optimization for Categorical and Category-Specific Continuous InputsDang Nguyen, Sunil Gupta, Santu Rana, Alistair Shilton et al.AAAI 2020 · 59 citations
  2. FOSS: A Self-Learned Doctor for Query OptimizerKai Zhong, Luming Sun, Tao Ji, Cuiping Li et al.ICDE 2024 · 5 citations
  3. Low Rank Learning for Offline Query OptimizationZixuan Yi, Yao Tian, Zachary G. Ives, Ryan MarcusSIGMOD 2025 · 4 citations
  4. LIMAO: A Framework for Lifelong Modular Learned Query OptimizationQihan Zhang, Shaolin Xie, Ibrahim SabekVLDB 2025 · 4 citations
  5. Reqo: A Comprehensive Learning-Based Cost Model for Robust and Explainable Query OptimizationBaoming Chang, Amin Kamali, Verena KantereSIGMOD 2026 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines