Cracking Query Bottlenecks: Towards Efficiency-Oriented Text-to-SQL Generation
Li Lin, Yunfeng Shen, Lingfeng Bao, Rongxin Wu, Yang Liu
Key points
From the paper's conclusion- We observe substantial efficiency gaps between models and emphasize that semantic correctness alone does not guarantee query efficiency.
Abstract
Text-to-SQL models translate natural language questions into SQL, enabling non-technical users to access databases. However, most existing research focuses on correctness, neglecting query efficiency. In this paper, we address the challenge of evaluating the execution efficiency of generated SQL in Text-to-SQL by introducing EESQLBench, a novel benchmark designed to assess both correctness and efficiency. EESQLBench pairs each natural language question with an expert-optimized SQL query, providing a reliable efficiency baseline. We evaluate six representative large language models (LLMs), including four open-source models (SQLCoder, CodeLlama, DeepSeek-Coder, and DeepSeek-R1) and two closed-source models (GPT-5.2 and Gemini-2.5-Pro), using cost-based metrics including Cost Reachability (CR) and Acceptable Reachability at kk (AR@kk). Our results reveal that current LLMs, despite achieving high correctness, struggle to produce efficient queries. We observe substantial efficiency gaps between models and emphasize that semantic correctness alone does not guarantee query efficiency. Furthermore, we provide insights into common inefficiency patterns in LLM-generated SQL queries, such as missing access pruning and inefficient subquery logic.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Text-to-SQL in the Era of Large Language Models: A Survey of Reasoning-Centric and Efficiency-Centric ApproachesElectronics · 2026
- text2ql: Multi-Target Natural Language Querying via a Language-Agnostic Intermediate RepresentationarXiv · 2026
- Reimagining Text-to-SQL: A Survey of Large Language Model Architectures and StrategiesarXiv · 2026
- Diff-SQL: SQL Efficiency Optimization via Patch Generation and Constraint AlignmentarXiv · 2026
- SQLBarber: A System Leveraging Large Language Models to Generate Customized and Realistic SQL WorkloadsProceedings of the ACM on Management of Data · 2026
- SchemaRAG: A Schema-aware Retrieval-Augmented Generation Framework for Text-to-SQLProceedings of the ACM on Management of Data · 2026