Home / Companies / Together AI / Blog / Post Details
Content Deep Dive

AI for Systems: Using LLMs to Optimize Database Query Execution

Blog post from Together AI

Post Details
Company
Date Published
Author
Together AI
Word Count
3,542
Language
English
Hacker News Points
-
Summary

A recent study explores how large language models (LLMs) can enhance database query optimization by addressing a key limitation in traditional query optimizers: their inability to understand semantic correlations in data. Through the introduction of DBPLANBENCH, a system that interacts with the Apache DataFusion engine, the study demonstrates significant improvements in query execution times and resource usage without altering the underlying database engine. This is achieved by translating complex physical execution plans into more manageable representations and applying targeted edits via evolutionary search. The system's efficiency is highlighted through case studies showing speedups of up to 4.78x in certain multi-join query scenarios, proving that LLMs can effectively function as semantic cardinality estimators. Moreover, the study establishes a practical workflow where optimizations found using smaller scale databases can be successfully transferred to larger ones, thereby validating the "optimize small, deploy large" approach. These findings indicate that AI and LLMs can not only support but also actively optimize the functional components of large-scale systems.