EUVIMEDEUVIMED entdecken
Crossref

Logical and Physical Optimizations for SQL Query Execution over Large Language Models

Dario Satriani, Enzo Veltri, Donatello Santoro, Sara Rosato, Simone Varriale, Paolo Papotti

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

DOI: 10.1145/3725411 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Proceedings of the ACM on Management of Data, online erschienen am 18.06.2025. Verfasst von Dario Satriani und 5 weiteren Autor:innen. Die Arbeit wurde bisher 16-mal zitiert (Crossref) und nennt 71 Literaturangaben. Gefördert von: Tech4You, Horizon 2020.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Interacting with Large Language Models (LLMs) via declarative queries is increasingly popular for tasks like question answering and data extraction, thanks to their ability to process vast unstructured data. However, LLMs often struggle with answering complex factual questions, exhibiting low precision and recall in the returned data. This challenge highlights that executing queries on LLMs remains a largely unexplored domain, where traditional data processing assumptions often fall short. Conventional query optimization, typically cost-driven, overlooks LLM-specific quality challenges such as contextual understanding. Just as new physical operators are designed to address the unique characteristics of LLMs, optimization must consider these quality challenges. Our results highlight that adhering strictly to conventional query optimization principles fails to generate the best plans in terms of result quality. To tackle this challenge, we present a novel approach to enhance SQL results by applying query optimization techniques specifically adapted for LLMs. We introduce a database system, GALOIS, that sits between the query and the LLM, effectively using the latter as a storage layer. We design alternative physical operators tailored for LLM-based query execution and adapt traditional optimization strategies to this novel context. For example, while pushing down operators in the query plan reduces execution cost (fewer calls to the model), it might complicate the call to the LLM and deteriorate result quality. Additionally, these models lack a traditional catalog for optimization, leading us to develop methods to dynamically gather such metadata during query execution. Our solution is compatible with any LLM and balances the trade-off between query result quality and execution cost. Experiments show up to 144% quality improvement over questions in Natural Language and 29% over direct SQL execution, highlighting the advantages of integrating database solutions with LLMs.

Förderung

  • Tech4You
  • Horizon 2020

Zitieren

APA

Satriani, D., Veltri, E., Santoro, D., Rosato, S., Varriale, S., & Papotti, P. (2025). Logical and Physical Optimizations for SQL Query Execution over Large Language Models. Proceedings of the ACM on Management of Data, 3(3), 1-28. https://doi.org/10.1145/3725411

Vancouver

Satriani D, Veltri E, Santoro D, Rosato S, Varriale S, Papotti P. Logical and Physical Optimizations for SQL Query Execution over Large Language Models. Proceedings of the ACM on Management of Data. 2025;3(3):1-28. doi:10.1145/3725411

BibTeX
@article{Satriani2025,
  author = {Satriani, Dario and Veltri, Enzo and Santoro, Donatello and Rosato, Sara and Varriale, Simone and Papotti, Paolo},
  title = {Logical and Physical Optimizations for SQL Query Execution over Large Language Models},
  journal = {Proceedings of the ACM on Management of Data},
  year = {2025},
  volume = {3},
  number = {3},
  pages = {1--28},
  doi = {10.1145/3725411}
}
Kostenlos starten →