Archive/Feedback-Driven SQL Optimization with Validated Query Rewrites
Feedback-Driven SQL Optimization with Validated Query Rewrites
Martin Kostov, Kalinka Kaloyanova
3 juillet 2026
en

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.

IPC Classification

G06

Keywords

feedback-drivenoptimizationvalidatedqueryrewriteselectronicscost-basedoptimizersessentialrelationaldatabasesystemsformulationstillaffectselectedexecutionplansruntimeespeciallyrecurringanalyticalworkloadsmachine-generated
Citer cette publication

€ 4.00