EUVIMEDEUVIMED entdecken
Crossref

Can Large Language Models Be Query Optimizer for Relational Databases?

Jie Tan, Kangfei Zhao, Rui Li, Jeffrey Xu Yu, Chengzhi Piao, Hong Cheng, Helen Meng, Deli Zhao, Yu Rong

Proceedings of the ACM on Management of Data · 04.12.2025 · 3 (6) · 1-28

DOI: 10.1145/3769771 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Proceedings of the ACM on Management of Data, online erschienen am 05.12.2025. Verfasst von Jie Tan und 8 weiteren Autor:innen. Die Arbeit wurde bisher 12-mal zitiert (Crossref) und nennt 70 Literaturangaben.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Query optimization is a complex planning and decision-making problem within the exponentially growing plan space in database management systems (DBMS). Traditional optimization techniques have been extensively studied over decades, leaving limited room for further improvement along this track. Recent developments of Large Language Models (LLMs) have demonstrated their potential in solving complex planning and decision-making problems, such as arithmetic and programmatic tasks. In this paper, we try to explore the potential of LLMs in handling query optimization and propose a tentative LLM-based query optimizer dubbed LLM-QO, established on PostgreSQL's execution engine. In LLM-QO, we formulate query optimization in an autoregressive fashion which directly generates the execution plan without explicit plan enumeration. To investigate the essential input of LLM-QO, we design a customized data recipe named QInstruct to collect the training data from various optimizers and serialize the database's meta data, queries and corresponding plans into a textual format. Based on QInstruct, we implement a two-stage fine-tuning pipeline, Query Instruction Tuning (QIT) and Query Direct Preference Optimization (QDPO), to empower the capability of general-purpose LLMs in handling query optimization. In our experiments, LLM-QO can generate valid and high-quality plans and consistently outperforms both traditional and learned optimizers on three query workloads. Our findings verify that LLMs can be derived as query optimizers where generalization, efficiency and adaptivity deserve further research efforts.

Zitieren

APA

Tan, J., Zhao, K., Li, R., Yu, J. X., Piao, C., Cheng, H., Meng, H., Zhao, D., & Rong, Y. (2025). Can Large Language Models Be Query Optimizer for Relational Databases?. Proceedings of the ACM on Management of Data, 3(6), 1-28. https://doi.org/10.1145/3769771

Vancouver

Tan J, Zhao K, Li R, Yu JX, Piao C, Cheng H, et al. Can Large Language Models Be Query Optimizer for Relational Databases?. Proceedings of the ACM on Management of Data. 2025;3(6):1-28. doi:10.1145/3769771

BibTeX
@article{Tan2025,
  author = {Tan, Jie and Zhao, Kangfei and Li, Rui and Yu, Jeffrey Xu and Piao, Chengzhi and Cheng, Hong and Meng, Helen and Zhao, Deli and Rong, Yu},
  title = {Can Large Language Models Be Query Optimizer for Relational Databases?},
  journal = {Proceedings of the ACM on Management of Data},
  year = {2025},
  volume = {3},
  number = {6},
  pages = {1--28},
  doi = {10.1145/3769771}
}
Kostenlos starten →