Test-Time Optimization of Physical Query Plans with LLMs
Not on the map. Why?
Abstract (arXiv)
Traditional query optimization relies on cost-based optimizers that estimate execution cost (e.g., runtime, memory, and I/O) using predefined heuristics and statistical models. Improving these requires substantial engineering effort, yet they often cannot exploit semantic correlations in queries and schemas that could enable better physical plans. Large language models (LLMs), however, can reason about column semantics, value distributions, and broader domain context that classical statistics miss. We introduce DBPlanBench, a harness for the DataFusion engine that exposes physical plans through a compact serialized representation and applies LLM-proposed edits as JSON patches. On this harness, we instantiate a test-time optimization workflow where an LLM examines physical query plans, proposes localized edits based on semantic reasoning, and an evolutionary search refines the candidates across iterations. We target OLAP queries, where heavy, repeated execution turns even small efficiency gains into substantial cumulative savings. We specifically focus our evaluation on join reordering and join-side selection, where cardinality-estimation errors compound multiplicatively. Median speedups reach 1.10-1.12× on TPC-H and 1.05-1.07× on TPC-DS, with some achieving up to 4.78×. We also demonstrate that optimizations discovered at small scale factors transfer effectively to larger ones, supporting a low-cost small-to-large workflow.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 9 of its 43 references that are in the map. First posted on arXiv 11 Feb 2026.
Builds on
9 of 43 references.
References · 9
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2026Kimi K2.5: Visual Agentic Intelligencecited by 501
- 2025KernelBench: Can LLMs Write Efficient GPU Kernels?cited by 225
- 2025ShinkaEvolve: Towards Open-Ended And Sample-Efficient Program Evolutioncited by 174
- 2025Barbarians at the Gate: How AI is Upending Systems Researchcited by 54
- 2025Can Large Language Models Be Query Optimizer for Relational Databases?cited by 11
- 2025Reinforced Generation of Combinatorial Structures: Hardness of Approximationcited by 9
- 2025SQLBarber: A System Leveraging Large Language Models to Generate Customized and Realistic SQL Workloadscited by 4
- 2025AI for Distributed Systems Design: Scalable Cloud Optimization Through Repeated LLMs Sampling And Simulatorscited by 1
Built on by
Not cited yet.