Skip to content

QueryBrew: System-Agnostic SQL-to-SQL Query Optimization

Aug 2026 · Proceedings of the VLDB Endowment · 0 citations · 14 references

TL;DR

QueryBrew is presented, a system-agnostic query optimization service that decouples the optimizer from the database engine through SQL-to-SQL rewriting, and distills the optimized execution plan back into an operator-oriented SQL representation.

Abstract

Efficient SQL execution heavily depends on the query optimizer's ability to find efficient query plans. Existing query optimizers differ widely in their capabilities, leading to significant differences in execution complexity across many queries. In this demonstration, we present QueryBrew, a system-agnostic query optimization service that decouples the optimizer from the database engine through SQL-to-SQL rewriting. QueryBrew takes arbitrary SQL queries, refines them using the state-of-the-art Umbra optimizer, and distills the optimized execution plan back into an operator-oriented SQL representation. This allows any target SQL database, such as PostgreSQL, DuckDB, ClickHouse, or SQL Server, to inherit advanced optimization techniques, such as general unnesting, simplification, and adaptive join ordering, without modification. The QueryBrew UI lets users explore and analyze the changes made by Umbra's query optimizer and how they affect execution in the target system. SQL-to-SQL optimization can improve runtimes by more than one order of magnitude for correlated and many-join queries.

View source

Similar papers

Preprint Sep 2026

Compiling Linear Datalog to SQL for Program Analysis

This paper revisits the connection between Datalog and relational databases, advocating recursive SQL as a backend for Datalog evaluation, and presents a compilation framework that translates Datalog programs, particularly those in the Linear Datalog fragment, into equivalent recursive SQL queries.

Amir Shaikhha, Anna Herlihy, Hung Q. Ngo · 0 citations
Preprint 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, Yichen Li, Zhuang-Bin Chen et al. · 0 citations
Preprint Aug 2026

DAGSmith: Dependency-Aware Rewriting for dbt-Style SQL Pipelines

DAGSmith is introduced, to the best of the authors' knowledge the first holistic dependency-aware source-to-source rewriting system for SQL pipeline DAGs and enables dependency-edge simplification, non-local semantic reuse, downstream-aware pruning, pipeline-aware work placement, rewrite-materialization co-optimization...

Jie Liu, Lin Ma, Barzan Mozafari · 0 citations
Aug 2026

iPDB: SQL with ML and LLM Predicates (Towards a Database Engine for AI)

iPDB is demonstrated, a system that supports in-database LLM inference using an extended declarative SQL syntax and new optimizations that result in efficient query processing of LLM-enabled SQL queries that outperform state-of-the-art systems.

Udesh Kumarasinghe, Tyler Liu, Ahmed R. Mahmood et al. · 0 citations
Open access May 2026

SafeQL: Search-based Refinement for Safe and Efficient LLM-based Text-to-SQL

SafeQL is proposed, a search-based refinement paradigm that redefines the role of the DBMS as an active guide in the refinement process, and significantly improves execution accuracy and efficiency compared to regeneration-based methods.

Geonho Lee, Min-Soo Kim · 0 citations

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