Vibeleaderboard
← All Intel
Intel / article

AI for Systems: Using LLMs to Optimize Database Query Execution

Source
together.ai
Author
Together AI
Date
Photo by Chirayu Sharma on Unsplash

Context

A database can return the right answer slowly because it performs operations in an inefficient order. DBPlanBench lets a inspect a compact representation of an execution plan and propose targeted changes. The system validates and runs candidate plans, retaining changes that reduce latency. Together AI's report describes this search around the existing DataFusion engine.

In one example, applying a selective date filter earlier reduced the rows entering later joins and produced a 4.78-fold speedup. Across generated TPC-H and TPC-DS workloads, median speedups were about 1.1–1.2 times. The larger example shows how correcting operation order can pay off; the medians better describe the typical gains in these experiments.

Terms in this piece · Glossary
  • LLM — A large language model — the neural network behind tools like Claude and ChatGPT, trained on huge amounts of text to predict what comes next.
Key quotes

“This structural optimization resulted in a 4.78x speedup for the query. More significantly, the resource footprint decreased drastically. The optimized plan reduced the aggregate hash-table build time from 10.16 seconds to 0.41 seconds and slashed total build memory usage from 3.3 GB to 411 MB.”

Together AI

“Not all queries can be effectively optimized, as the plans might already be optimal, but we find that in our sampled datasets, 60.8% of those queries could be optimized by more than 5%.”

Together AI

“DBPlanBench thereby converts the optimization task from a statistical computation into a semantic reasoning problem, in which the LLM analyzes the plan's topology to identify logical flaws in join ordering.”

Together AI

“the median speedups hovered around 1.1x to 1.2x, and the method also delivered much larger gains on some complex multi-join queries, for example, speedups of up to 4.78×, with several others in the 1.5-1.7x range.”

Together AI

“Empirically, every optimized plan we selected at SF3 could be successfully transferred to SF10, and the resulting speedups closely tracked the original ones.”

Together AI
Read the source www.together.ai
More from Together AI
Recommended reads
Comments

Checking sign-in…

Loading comments…