Learned Offline Query Planning via Bayesian Optimization
Jeffrey Tao, Natalie Maus, Haydn Thomas Jones, Yimeng Zeng, Jacob R. Gardner, Ryan Marcus
Abstract
Analytics database workloads often contain queries that are executed repeatedly. Existing optimization techniques generally prioritize keeping optimization cost low, normally well below the time it takes to execute a single instance of a query. If a given query is going to be executed thousands of times, could it be worth investing significantly more optimization time? In contrast to traditional online query optimizers, we propose an offline query optimizer that searches a wide variety of plans and incorporates query execution as a primitive. Our offline query optimizer combines variational auto-encoders with Bayesian optimization to find optimized plans for a given query. We compare our technique to the optimal plans possible with PostgreSQL and recent RL-based systems over several datasets, and show that our technique finds faster query plans. 1 Some unknown proportion of these verbatim repeats may involve staging tables or views, for which the underlying query may be changing.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext d5b858d8-1ebe-469b-975b-c94519c8abdbCited by top-tier papers6
- This is Going to Sound Crazy, But What If We Used Large Language Models to Boost Automatic Database Tuning Algorithms By Leveraging Prior History? We Will Find Better Configurations More Quickly Than Retraining From Scratch!William Zhang, Wan Shen Lim, Andrew PavloSIGMOD 2026 · 7 citations
- Low Rank Learning for Offline Query OptimizationZixuan Yi, Yao Tian, Zachary G. Ives, Ryan MarcusSIGMOD 2025 · 4 citations
- LLM4Hint: Leveraging Large Language Models for Hint Recommendation in Offline Query OptimizationSuchen Liu, Yang Lin, Yinjun Han, Jun GaoICDE 2026 · 1 citation
- Scaling Multi-Task Bayesian Optimization with Large Language ModelsYimeng Zeng, Natalie Maus, Haydn Thomas Jones, Jeffrey Tao et al.ICLR 2026 · 1 citation
- OBELISK: Efficient Offline Query Planning with Bayesian Optimization-Informed Language Model ReasoningZhicheng Pan, Wenwen Sun, Yuanjia Zhang, Terence Purcell et al.VLDB 2026
Builds on37
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
- An End-to-End Learning-based Cost EstimatorJi Sun, Guoliang LiVLDB 2020 · 251 citations
- Bao: Making Learned Query Optimization PracticalRyan Marcus, Parimarjan Negi, Hongzi Mao, Nesime Tatbul et al.SIGMOD 2021 · 242 citations
- Sample-Efficient Optimization in the Latent Space of Deep Generative Models via Weighted RetrainingAustin Tripp, Erik A. Daxberger, José Miguel Hernández-LobatoNeurIPS 2020 · 186 citations
- Reinforcement Learning with Tree-LSTM for Join Order SelectionXiang Yu, Guoliang Li, Chengliang Chai, Nan TangICDE 2020 · 168 citations
Related papers
- Practical Parameterized Query Optimization via Efficient Plan Reuse and List-wise RankingHai Lan, Yang Yu, Zhifeng Bao, Zi Huang et al.SIGMOD 2026
- GLO: Towards Generalized Learned Query OptimizationTianyi Chen, Jun Gao, Yaofeng Tu, Mo XuICDE 2024 · 7 citations
- Lequa: A Learning-Based Query-Aware Framework for Selective Query OptimizationGuoneng Li, Pengfei Zheng, Ling Xu, Yan Li et al.ICDE 2026
- Athena: An Effective Learning-based Framework for Query Optimizer Performance ImprovementRunzhong Li, Qilong Li, Haotian Liu, Rui Mao et al.SIGMOD 2025 · 3 citations
- Leveraging Query Logs and Machine Learning for Parametric Query OptimizationKapil Vaidya, Anshuman Dutt, Vivek R. Narasayya, Surajit ChaudhuriVLDB 2022 · 20 citations
