Skip to content
Open access

Feedback-Driven SQL Optimization with Validated Query Rewrites

Jul 2026 · Electronics · Vol 15, pp. 2931 · 0 citations · 16 references

TL;DR

A feedback-driven lifecycle for SQL optimization, based on empirically validated query rewrites, which supports a source-neutral lifecycle in which alternative SQL formulations are admitted, measured, retained, activated, or rejected according to accumulated evidence rather than the generating mechanism.

Abstract

Cost-based query optimizers are essential for relational database systems, but SQL formulation can still affect selected execution plans and runtime, especially in recurring analytical workloads and machine-generated queries. This paper proposes a feedback-driven lifecycle for SQL optimization, based on empirically validated query rewrites. The contribution of the presented approach is a persistent candidate-management process that covers the path from candidate intake to provenance recording, structural admissibility checks, empirical result-equivalence validation, paired runtime evidence, guarded activation, retention, rejection, and later deactivation. Candidate rewrites may come from deterministic rules, local large language models, manual alternatives, or external rewrite systems; the source is recorded but does not determine acceptance. The evaluation uses a controlled research implementation with deterministic-rule cases, repeated TPC-H SF1 runs, a real-world-style anti-pattern corpus, and JOB/IMDB. The results show conservative behavior on mature analytical templates, including mostly withheld TPC-H candidates with one held-out positive case, stable evidence for selected anti-patterns, and comparable but non-identical JOB/IMDB positives across runs. The findings support a source-neutral lifecycle in which alternative SQL formulations are admitted, measured, retained, activated, or rejected according to accumulated evidence rather than the generating mechanism.

Read PDF

Similar papers

Jul 2026

SQL-RewriteBench: A Correctness-Gated, Full-Denominator Benchmark for Statement-Level SQL Rewriting [Experiment,Analysis & Benchmark]

SQL-RewriteBench is presented, a benchmark for statement-level SQL rewriting that applies correctness gating and full-denominator accounting and shows that deployable SQL rewrite requires broader input handling, result validation, and benefit-aware rewrite decisions.

Jiang Long, Tian-Ci Gao, Shi-Yuan Hao et al. · 0 citations
Open access 2026

LLM-augmented query optimization: a hybrid framework for intelligent SQL performance tuning

LLM-QOpt++ is presented, a novel hybrid, confidence-aware query optimization framework that unifies traditional CBO estimation, machine learning–based cost prediction, and large language model (LLM) reasoning within a single adaptive pipeline.

Hanan Abed Alwally Abed Allah · 0 citations

ExpeSQL: An Efficient, Experience-Guided Decompositional Search Framework for Text-to-SQL

This work introduces ExpeSQL, a zero-shot, open-source–compatible, and efficient framework that combines divide-and-conquer reasoning, Best-of-N candidate selection, and self-critique with experience-guided refinement that establishes a new paradigm for deployable, self-improving Text-to-SQL systems in dynamic, real-wo...

Unknown authors · 0 citations
Book Open access Apr 2026

DBcover: A White-box SQL Test Generation Framework for Coverage Improvement

DBcover is proposed, an LLM-driven database test generation framework that performs white-box, code-aware SQL test generation through contextual reasoning, and substantially outperforms existing fuzzers.

Yan-Kai Rong, Shuang Liu, Jin-Hao Dong et al. · 0 citations
Book Open access Aug 2026

AutoSQL: Extracting SQL Templates from Imperative ORM Code in Large-Scale Repositories

This work presents AutoSQL, a system that reconstructs SQL templates from Go ORM code that constructs a Code Index, a directed graph that captures structural dependencies between functions, types, and global variables as navigable edges and synthesizes SQL templates.

Jun-Song Pu, Yi-Chen Li, Zhuang-Bin Chen et al. · 0 citations
Open access Jul 2026

Benchmarking the Full Pipeline of Materialized-View-Based Query Rewriting

This paper benchmarks MV-based query rewriting by jointly evaluating enumeration, selection, and rewriting with a modular evaluation framework and by using controlled ablations, and introduces a cross-engine protocol allowing us to compare systems that expose only execution plans by contrasting native optimizer-level r...

Xin-Jie Hu, Zheng-Jie Miao · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.