AI-Based SQL Query Optimization Using Large Language Models: A Framework for Intelligent Database Query Performance Enhancement
DOI:
https://doi.org/10.5281/zenodo.21618939Keywords:
SQL Query Optimisation, Artificial Intelligence, Large Language Models, Database Management System, Query Execution Plan, Cost-Based Optimisation, Natural Language Processing.Abstract
Structured Query Language (SQL) is the standard language used to manage and retrieve data from relational databases. As modern applications generate massive volumes of data, optimising SQL queries has become increasingly important for improving database performance and reducing execution time. Traditional query optimisation techniques rely on rule-based and cost-based optimisers, which often struggle with complex queries, dynamic workloads, and evolving database environments. Recent advancements in Artificial Intelligence (AI), particularly Large Language Models (LLMs), provide new opportunities for intelligent SQL query optimisation. LLMs can understand natural language, analyse SQL syntax, identify inefficient query patterns, and recommend optimised query structures. They can also assist developers in writing efficient SQL statements and improving query execution plans. This paper presents a conceptual framework for AI-based SQL query optimisation using Large Language Models. The proposed approach integrates an LLM with a traditional Database Management System (DBMS) to enhance query rewriting, indexing recommendations, join optimisation, and execution plan analysis. The framework aims to improve query performance, reduce execution cost, and support database administrators in optimising complex SQL queries. The study also discusses the potential benefits, challenges, and future research directions in AI-assisted database optimisation.Downloads 4 and Views 0
References
Published
How to Cite
https://doi.org/10.5281/zenodo.21618939
Issue
Section
Copyright (c) 2026, Tripti Sharma
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.



