SEFRQO-Plus: a self-evolving query optimizer via large language models and retrieval-augmented generation

Abstract 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. We initially proposed SEFRQO, a Self-Evolving Fine-tuned RAG-based Query Optimizer, which leverages fine-tuned LLMs to address these challenges and uses in-context learning to achieve continuous evolution. However, its system design relies on the assumption of repetitive query workloads, requires executing queries statically upon their first encounter (incurring extra overhead), and utilizes only partial feedback from the best historical records (insufficient feedback design). In this paper, we present SEFRQO-Plus, which resolves the above limitations. First, we design a feedback-oriented vector database with query structure-aware embeddings to support effective similarity search, and we incorporate multi-layered histories as references to enrich the feedback. Then, we enhance the prompt optimization workflow by utilizing multi-dimensional historical feedback to drive continuous self-evolution. Moreover, we provide formal theoretical proofs to validate the advantages of our customized query group relative policy optimization. Evaluations show that SEFRQO-Plus outperforms state-of-the-art LQOs, achieving reductions of 66.52% and 69.79% in query latency for the complete CEB and Stack workloads, respectively, compared to PostgreSQL. SEFRQO-Plus achieves an additional 15% improvement over the initial SEFRQO. Moreover, it generalizes effectively across multiple workloads and scenarios, and even across different DBMSes.

Authors

Institutions

Publication Details

Journal
The VLDB Journal
Published
2026-10-15
DOI
https://doi.org/10.1007/s00778-026-00999-z
Primary Topic
Advanced Database Systems and Queries
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

SEFRQO-Plus: a self-evolving query optimizer via large language models and retrieval-augmented generation

Ryan Marcus, Ibrahim Sabek, Hanwen Liu, Q. Zhang
The VLDB Journal
Advanced Database Systems and Queries
article

SEFRQO-Plus: a self-evolving query optimizer via large language models and retrieval-augmented generation

Ryan Marcus, Ibrahim Sabek, Hanwen Liu, Q. Zhang
article en

Abstract

Abstract 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. We initially proposed SEFRQO, a Self-Evolving Fine-tuned RAG-based Query Optimizer, which leverages fine-tuned LLMs to address these challenges and uses in-context learning to achieve continuous evolution. However, its system design relies on the assumption of repetitive query workloads, requires executing queries statically upon their first encounter (incurring extra overhead), and utilizes only partial feedback from the best historical records (insufficient feedback design). In this paper, we present SEFRQO-Plus, which resolves the above limitations. First, we design a feedback-oriented vector database with query structure-aware embeddings to support effective similarity search, and we incorporate multi-layered histories as references to enrich the feedback. Then, we enhance the prompt optimization workflow by utilizing multi-dimensional historical feedback to drive continuous self-evolution. Moreover, we provide formal theoretical proofs to validate the advantages of our customized query group relative policy optimization. Evaluations show that SEFRQO-Plus outperforms state-of-the-art LQOs, achieving reductions of 66.52% and 69.79% in query latency for the complete CEB and Stack workloads, respectively, compared to PostgreSQL. SEFRQO-Plus achieves an additional 15% improvement over the initial SEFRQO. Moreover, it generalizes effectively across multiple workloads and scenarios, and even across different DBMSes.

The VLDB JournalVol. 35(6)
University of Southern California (US), University of Pennsylvania (US)
Openalex Percentile: Top 12%
Advanced Database Systems and Queries
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.