[Paper Review] ResQ: Realistic Performance-Aware Query Generation
ResQ generates executable SQL workloads that faithfully reproduce per-query execution targets and operator distributions from anonymized production traces, using a two-phase query graph generation, repetition-aware query pools, and cost-aware optimization.
Database research and development rely heavily on realistic user workloads for benchmarking, instance optimization, migration testing, and database tuning. However, acquiring real-world SQL queries is notoriously challenging due to strict privacy regulations. While cloud database vendors have begun releasing anonymized performance traces to the research community, these traces typi- cally provide only high-level execution statistics without the origi- nal query text or data, which is insufficient for scenarios that require actual execution. Existing tools fail to capture fine-grained perfor- mance patterns or generate runnable workloads that reproduce these public traces with both high fidelity and efficiency. To bridge this gap, we propose ResQ, a fine-grained workload synthesis sys- tem designed to generate executable SQL workloads that faithfully match the per-query execution targets and operator distributions of production traces. ResQ constructs execution-aware query graphs, instantiates them into SQL via Bayesian Optimization-driven pred- icate search, and explicitly models workload repetition through reuse at both exact-query and parameterized-template levels. To ensure practical scalability, ResQ combines search-space bounding with lightweight local cost models to accelerate optimization. Ex- periments on public cloud traces (Snowset, Redset) and a newly released industrial trace (Bendset) demonstrate that ResQ signif- icantly outperforms state-of-the-art baselines, achieving 96.71% token savings and a 86.97% reduction in runtime, while lowering maximum Q-error by 14.8x on CPU time and 997.7x on scanned bytes, and closely matching operator composition.
Motivation & Objective
- Motivate the need for realistic, per-query workloads in cloud database benchmarking under privacy constraints.
- Formalize the problem of generating queries that satisfy structure and execution targets from anonymized traces.
- Propose a two-phase, performance-aware generation pipeline that yields executable SQL without accessing original data.
- Enable repetition-aware synthesis and scalable generation with lightweight cost models to support large-scale benchmarks.
Proposed method
- Represent queries as execution-oriented graphs (Query Graph G) to capture operators and dataflow before SQL syntax.
- Use a two-phase process: Phase I bounds the search space by data access and cost feasibility to produce feasible base graphs, Phase II performs predicate search to match CPU time targets.
- Instantiate edges from query graphs into executable SQL via a dedicated translator, aided by an LLM for dialect-specific details.
- Leverage a lightweight local performance model to estimate CPU time and guide Bayesian optimization, reducing expensive executions.
- Maintain a query pool with exact and parameterized reuse to recover repetition and improve efficiency.
Experimental results
Research questions
- RQ1How to synthesize executable SQL queries that meet per-query execution targets and structure-aware constraints from anonymized traces?
- RQ2Can a two-phase, data-aware graph generation approach produce high-fidelity workloads that reproduce repetition and operator distributions?
- RQ3What mechanisms (e.g., local cost models, BO, query pools) enable scalable, accurate, and privacy-preserving workload generation at scale?
Key findings
- ResQ achieves substantial fidelity to target traces while reducing cost: up to 96.71% token savings and 86.97% reduction in runtime.
- ResQ lowers maximum Q-error in CPU time and scanned bytes by 14.8× and 997.7×, respectively, on CPU time and scanned bytes.
- ResQ closely matches operator composition and supports fine-grained per-query target matching beyond coarse-window approaches.
- Phase I data-aware bounding effectively prunes infeasible graphs by bounding scanned bytes before predicate tuning.
- Phase II uses a two-stage Bayesian optimization for predicate tuning, improving exploration and exploitation around target CPU times.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.