Numerous studies have explored the SQL query refinement problem, where the objective is to minimally modify an input query so that it satisfies a specified set of constraints. However, these works typically target restricted classes of queries or constraints. We present OmniTune, a general framework for refining arbitrary SQL queries using LLM-based optimization by prompting (OPRO). OmniTune employs a two-step OPRO scheme that explores promising refinement subspaces and samples candidates within them, supported by concise history and skyline summaries for effective feedback. Experiments on a comprehensive benchmark demonstrate that OmniTune handles both previously studied refinement tasks and more complex scenarios beyond the scope of existing solutions.
翻译:已有大量研究探索了SQL查询优化问题,其目标是以最小修改调整输入查询,使其满足特定约束条件。然而,这些工作通常仅针对受限的查询类别或约束类型。本文提出OmniTune——一个基于LLM提示优化(OPRO)的通用框架,用于优化任意SQL查询。OmniTune采用两步式OPRO方案:首先探索有潜力的优化子空间,随后在其中采样候选方案,并通过简明的历史记录与天际线摘要机制提供有效反馈。在综合性基准测试上的实验表明,OmniTune既能处理已有研究涉及的优化任务,也能应对超出当前解决方案范围的更复杂场景。