Together Research says LLMs can repair bad database query plans

On April 3, 2026, Together AI’s X account promoted new research claiming that LLMs can repair query plans when a database optimizer misses semantic correlations. The post highlights DBPlanBench, a system that hands the LLM a database’s physical operator graph and asks it to patch the plan directly instead of rewriting the full execution strategy from scratch.

What the research claims

The team says DBPlanBench works on Apache DataFusion plans and uses localized edits plus an evolutionary search loop to refine candidates. In the X post, Together reports up to 4.78x speedups on TPC-H and TPC-DS, says 60.8% of tested queries improved by more than 5%, and cites a build-memory reduction from 3.3 GB to 411 MB in one of its examples. The related arXiv paper describes the motivation in conventional database terms: cost estimators can miss semantic correlations in data, which in turn leads to bad join order, bad access paths, and cascading planning errors.

Why it matters

This is a useful example of LLMs being applied below the application layer, inside systems infrastructure that normally depends on handwritten heuristics. The notable design choice is not to have the model generate a brand-new plan, but to let it inspect an already-optimized physical plan and suggest bounded changes that can be executed and evaluated. If the approach holds up beyond benchmark settings, it could open a path to narrower, higher-confidence uses of LLMs in database engines and other optimization stacks.

Source materials include Together AI’s X post and the paper “Making Databases Faster with LLM Evolutionary Sampling”.