SEFRQO: A Self-Evolving Fine-Tuned RAG-Based Query Optimizer
Not on the map. Why?
Abstract (arXiv)
Query optimization is a crucial problem in database systems that has been studied for decades. Learned query optimizers (LQOs) can improve performance over time by incorporating feedback; however, they suffer from cold-start issues and often require retraining when workloads shift or schemas change. Recent LLM-based query optimizers leverage pre-trained and fine-tuned LLMs to mitigate these challenges. Nevertheless, they neglect LLMs' in-context learning and execution records as feedback for continuous evolution. In this paper, we present SEFRQO, a Self-Evolving Fine-tuned RAG-based Query Optimizer. SEFRQO mitigates the cold-start problem of LQOs by continuously learning from execution feedback via a Retrieval-Augmented Generation (RAG) framework. We employ both supervised fine-tuning and reinforcement fine-tuning to prepare the LLM to produce syntactically correct and performance-efficient query hints. Moreover, SEFRQO leverages the LLM's in-context learning capabilities by dynamically constructing prompts with references to similar queries and the historical execution record of the same query. This self-evolving paradigm iteratively optimizes the prompt to minimize query execution latency. Evaluations show that SEFRQO outperforms state-of-the-art LQOs, achieving up to 65.05% and 93.57% reductions in query latency on the CEB and Stack workloads, respectively, compared to PostgreSQL.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 24 Aug 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2025A Comprehensive Survey on Reinforcement Learning-based Agentic Search: Foundations, Roles, Optimizations, Evaluations, and Applicationscited by 22
- 2026Hard Constraints Meet Soft Generation: Guaranteed Feasibility for LLM-based Combinatorial Optimizationcited by 3
- 2026GenDB: The Next Generation of Query Processing -- Synthesized, Not Engineeredcited by 1
- 2026Piece of CAKE: Adaptive Execution Engines via Microsecond-Scale Learningcited by 0
- 2026GenDB: The Next Generation of Query Processing -- Synthesized, Not Engineered2 Mar 2026
- 2026Piece of CAKE: Adaptive Execution Engines via Microsecond-Scale Learning4 Feb 2026
- 2026Hard Constraints Meet Soft Generation: Guaranteed Feasibility for LLM-based Combinatorial Optimization1 Feb 2026
- 2025A Comprehensive Survey on Reinforcement Learning-based Agentic Search: Foundations, Roles, Optimizations, Evaluations, and Applications19 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2024A Survey of Query Optimization in Large Language Models
- 2024The Unreasonable Effectiveness of LLMs for Query Optimization
- 2026RELOAD: A Robust and Efficient Learned Query Optimizer for Database Systems
- 2026EvoSQL: Memory-Augmented Critic-Generator Co-Evolution for Text-to-SQL
- 2024RaFe: Ranking Feedback Improves Query Rewriting for RAG
- 2026CA-SQL: Complexity-Aware Inference Time Reasoning for Text-to-SQL via Exploration and Compute Budget Allocation
- 2025LTRR: Learning To Rank Retrievers for LLMs
- 2026RAG without Forgetting: Continual Query-Infused Key Memory