Skip to main content
QUICK REVIEW

[Paper Review] Making Databases Faster with LLM Evolutionary Sampling

Mehmet Hamza Erol, Xiangpeng Hao|arXiv (Cornell University)|Feb 11, 2026
Advanced Database Systems and QueriesComputer Science0 citations
TL;DR

The paper introduces DBPlanBench, a harness that uses an LLM to propose semantic, localized edits to a database engine’s physical query plans and uses evolutionary sampling to optimize execution plans, achieving up to 4.78x speedups on OLAP queries and demonstrating transfer from small to large scales.

ABSTRACT

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 heuristics requires substantial engineering effort, and even when implemented, these heuristics often cannot take into account semantic correlations in queries and schemas that could enable better physical plans. Using our DBPlanBench harness for the DataFusion engine, we expose the physical plan through a compact serialized representation and let the LLM propose localized edits that can be applied and executed. We then apply an evolutionary search over these edits to refine candidates across iterations. Our key insight is that LLMs can leverage semantic knowledge to identify and apply non-obvious optimizations, such as join orderings that minimize intermediate cardinalities. We obtain up to 4.78$ imes$ speedups on some queries and we demonstrate a small-to-large workflow in which optimizations found on small databases transfer effectively to larger databases.

Motivation & Objective

  • Motivate improving query plan optimization beyond traditional cost-based heuristics by leveraging semantic knowledge in LLMs.
  • Expose and manipulate the database engine’s physical plan to an LLM via a compact, token-efficient serialization.
  • Demonstrate that localized plan edits, guided by semantic cardinality estimates, can yield significant speedups.
  • Show that optimizations found on small databases transfer effectively to larger databases.

Proposed method

  • Expose DataFusion physical plans through a dedicated JSON serialization layer into a compact representation.
  • Provide an LLM with the plan and a patch-based editing interface to generate localized JSON Patch operations.
  • Use an evolutionary sampling framework (PST-Evol and BoL-Evol) to iteratively apply patches and evaluate end-to-end execution time in sandboxed runs.
  • Instruct the LLM to perform semantic cardinality estimation and propose join-side selection and join-reordering transformations.
  • Execute transformed plans in DataFusion and measure robustness and correctness across multiple sandboxes to obtain reliable speedups.
Figure 1 : Semantic-aware Join Optimization. By identifying the high selectivity of the ‘date’ predicate, the plan can be reordered to prune data early, significantly reducing the cardinality of the subsequent JOIN . We explore this use case in Section 5 .
Figure 1 : Semantic-aware Join Optimization. By identifying the high selectivity of the ‘date’ predicate, the plan can be reordered to prune data early, significantly reducing the cardinality of the subsequent JOIN . We explore this use case in Section 5 .

Experimental results

Research questions

  • RQ1Can an LLM leveraging semantic knowledge discover plan-wide and local optimizations that outperform traditional rule-based optimizers?
  • RQ2Do localized JSON Patch edits to a serialized physical plan suffice to realize meaningful speedups without full plan rewrites?
  • RQ3Are optimizations found on small scale transferable to larger databases while preserving performance gains?

Key findings

  • LLMs can achieve substantial query-plan speedups, with up to 4.78x end-to-end improvement on certain TPC-DS derived queries.
  • On average, median speedups are around 1.15x–1.2x for TPC-H and around 1.1x for TPC-DS across evaluated workloads.
  • Semantic, non-obvious optimizations include join reordering and join-side swaps guided by cardinality reasoning that traditional heuristics can miss.
  • Optimizations discovered at small scale transfer effectively to larger scale databases, preserving speedup patterns under a deterministic transfer procedure.
  • Three evolutionary steps are generally enough to reach near-peak speedups, with diminishing returns beyond step 3.
  • The approach outperforms the baseline DataFusion optimizer on several complex multi-join queries.
Figure 2 : DBPlanBench , provides accessible APIs to extract a physical plan that an LLM can edit. This plan can be then executed in DataFusion as if it was a native DataFusion plan.
Figure 2 : DBPlanBench , provides accessible APIs to extract a physical plan that an LLM can edit. This plan can be then executed in DataFusion as if it was a native DataFusion plan.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.