# Learned Offline Query Planning via Bayesian Optimization

arXiv: https://arxiv.org/abs/2502.05256 · HTML: https://mlsanity.com/paper/2502.05256/

## Key facts

- Cited by 4 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 7 Feb 2025.

## Built on by (most cited first, 4 of 4)

- [Large Scale Multi-Task Bayesian Optimization with Large Language Models](https://mlsanity.com/paper/2503.08131/) (2025)
- [Low Rank Learning for Offline Query Optimization](https://mlsanity.com/paper/2504.06399/) (2025)
- [LLM4Hint: Leveraging Large Language Models for Hint Recommendation in Offline Query Optimization](https://mlsanity.com/paper/2507.03384/) (2025)
- [Adversarial Query Synthesis via Bayesian Optimization](https://mlsanity.com/paper/2603.01570/) (2026)

## Abstract (arXiv)

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.
