Realistic Performance-Aware Query Generation
summary
The gist
Realistic Performance-Aware Query Generation proposes ResQ, a fine-grained workload synthesis system designed to generate executable SQL workloads that faithfully match the per-query execution…
In short
ResQ is a fine-grained workload synthesis system designed to create executable SQL queries that precisely match production trace execution targets and operator distributions. It uses a two-phase pipeline—space bounding followed by cost-aware refinement—and incorporates lightweight local performance models to efficiently guide the generation process, achieving high fidelity on various benchmarks.
Key concepts
- Realistic Performance-Aware Query Generation (RPQG)
- This is the core problem of creating executable SQL queries that not only follow structural rules but also closely mimic how real user queries actually run in a production database. The goal is to synthesize a query ($q^*$) that satisfies structural constraints while matching specific execution targets ($Y$) like CPU time and operator usage.
- Two-Phase Generation Pipeline
- ResQ uses a two-step approach to build the target query. Phase I first builds a basic query graph that respects the required structure. Phase II then takes this base and refines it using cost estimates to precisely hit the desired execution time targets, ensuring performance fidelity.
- Local Performance Models
- These are lightweight models embedded in ResQ that estimate important metrics, primarily CPU time, directly from a query's operator features. They are used strategically during the search process to quickly prune bad candidates early (bounding) and guide the refinement steps efficiently.
Terminology used across episodes
This episode discusses
- Realistic Performance-Aware Query Generation · Paper Radio
- DeepDB: Learn from Data, not from Queries!
- Learned Cardinalities: Estimating Correlated Joins with Deep Learning
- Redbench: A Benchmark Reflecting Real Workloads
- SQLBarber: A System Leveraging Large Language Models to Generate Customized and Realistic SQL Workloads
- NeuroCard: One Cardinality Estimator for All Tables
- Blueprinting the Cloud: Unifying and Automatically Optimizing Cloud Data Infrastructures with BRAD -- Extended Version
The paper
Realistic Performance-Aware Query Generation · Read on arXiv
Purdue University · Databend Cloud
Transcript
Introduction to the show: ident: Computer Science. The day in computer science: software, systems and theory on arXiv.
Tom: I'm Tom.
Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.
Tom: We're looking at the paper: "Realistic Performance-Aware Query Generation".
Paper summary: Tom: So we're looking at this paper today called "Realistic Performance-Aware Query Generation," by Zhengle Wang and others. Basically they’re tackling the problem of creating real SQL queries that actually look like what users are running in production, which is tough because of privacy rules.
Jane: That sounds really important because databases rely on these realistic workloads to test performance and tune systems, but getting actual user queries is almost impossible to get legally.
Tom: Exactly. The core problem they're facing is that existing synthetic workloads often give misleading benchmark results, so this paper proposes something called ResQ, which is a fine-grained system for generating executable SQL that matches the execution targets and operator distributions of production traces.
Lu: What's interesting about ResQ is that they are building a very structured pipeline to get this fidelity without just guessing, because matching multiple execution targets per query is much harder than just hitting one big cost target.
Meng: I wonder how they manage the complexity of matching those multiple targets across different operators; in production, you don't just want to hit one number, you want the whole execution profile to be right.
Lalam: The abstract says ResQ constructs an execution-aware query graph and focuses on matching both structural constraints and execution targets simultaneously, which is a big step because previous methods either did it coarsely or used LLMs in ways that made fine-grained control difficult.
Jane: So, what does this mean for us? It means we can finally generate workloads that are much closer to reality than what we've seen before, which is crucial for accurate performance diagnosis.
Tom: Right. And the paper claims they solved this by explicitly separating the construction of the structure, bounding the search space based on data awareness and then refining it using cost-aware refinement to hit those CPU time targets.
Lu: I'm curious about that two-phase pipeline; Phase One builds a base query graph that satisfies structural constraints over a proxy dataset, and Phase Two uses local performance models to guide the search toward the target execution time.
Paper summary: Meng: Local performance models sound fast, but how reliable are they when you're trying to prune candidates in a massive search space? I need to know if we're just spending time running too many queries before we even start refining.
Tom: The paper says these lightweight local prediction models estimate things like CPU time from operator-level features and intermediate statistics, and they use that feedback both for cost-aware bounding to prune infeasible queries early, and during the search phase to give cheap feedback for the exploration.
Jane: So, it’s a way to be smart about where you look in the search space instead of just running every single candidate query to completion. That sounds like a practical efficiency gain.
Lu: And they address repetition patterns by using two levels of query pools: one based on exact query hash for structural repetition, and another based on parameterized hash which normalizes the parameters and predicates across different queries.
Meng: Reusing queries is good, but when you're matching execution profiles, does reusing a structurally similar query actually guarantee matching the execution statistics you need? That’s where I worry about fidelity.
Lalam: The paper claims this dual-level pool helps manage challenge two by providing both exact structural repetition and parameterized abstraction, which means they can reuse patterns efficiently while still allowing for fine-grained control over parameters during refinement.
Tom: So the paper shows a significant improvement in efficiency too; they report gains like ninety-six point seventy-one percent token savings and an eighty six point ninety seven percent reduction in runtime compared to state of the art baselines on tests like Snowset, Redset, and the new Bendset trace.
Jane: That reduction in runtime is huge for anyone doing capacity planning or autoscaling; it means faster iteration cycles when building performance tests.
Lu: The results on Bendset Trace two are particularly interesting because ResQ achieves a median CPU Time Q error of one point thirteen which beats SQLBarber at two point thirty-one and SQLSmith-Q at two point nineteen by a factor close to two.
Paper summary: Meng: A factor of two improvement is significant, but I still need to see how this holds up when we introduce real traffic patterns that aren't just from those public traces. That's where I have my doubts about generalizing the performance modeling aspect.
Tom: The authors show that ResQ consistently achieves the best target-fitting accuracy across both CPU time and scanned bytes, and they also maintain near zero mean absolute error for Join, Aggregate, and Sort operators in Table four.
Jane: So it’s not just about getting the total CPU time right; it’s granular accuracy on specific operations like joins and sorts too. That tells us the model is really learning the execution behavior at a deeper level.
Lu: The paper also released a new fine-grained workload trace called Bendset, which covers diverse real-world use cases, suggesting they tested this system against something more complex than just existing public data.
Meng: Testing on that new industrial trace is important because that's what we actually deal with at scale, and it shows the system can handle diversity in a way prior methods couldn't.
Lalam: The paper concludes by saying ResQ achieves high fidelity and efficiency across Snowset, Redset, and the newly released Bendset.
Tom: So to wrap up on "Realistic Performance-Aware Query Generation," this work moves beyond just generating queries that are syntactically correct or hitting a single cost target.
Jane: It’s about matching the fine-grained execution targets and operator distributions of real production traces, and they achieved this using a structured pipeline with data-aware bounding and cost-aware refinement.
Lu: For the world, this suggests that we can move toward synthesizing workloads that are far more representative of actual user behavior than what was previously possible.
Meng: From an engineering standpoint, it means we have a framework for generating realistic performance tests much faster and with better accuracy than before.
Lalam: The authors conclude that ResQ achieves high fidelity and efficiency on Snowset, Redset, and the newly released Bendset.
Conclusion: Tom: So we've been looking at this paper, "Realistic Performance-Aware Query Generation." Basically, they built a system called ResQ to make SQL queries that actually look like what real users run in production.
Jane: That’s right, Tom. They are taking the problem of creating realistic data for performance testing and making it fine-grained so it matches the execution targets perfectly.
Lu: The authors focus on matching not just a single cost target, but all those different execution profiles per query, which is a much harder task than the older methods they were trying to beat.
Meng: So what’s the actual result here? Is this system actually deployable on a real database where I can use it for testing?
Tom: Well, the numbers are pretty impressive. They showed that ResQ significantly outperformed existing systems on public cloud traces like Snowset and Redset.
Jane: They achieved things like a ninety-six point seventy-one percent token saving and an eighty six point ninety seven percent reduction in runtime when compared to the baselines they tested against.
Lu: Specifically, on a new industrial trace they released, Bendset, ResQ showed a median CPU Time error of one point thirteen. That beats SQLBarber by about two times.
Meng: Two times is good, but that’s still just a number on a benchmark. What happens when you put this thing on real traffic that isn't in those public traces?
Jane: That’s the next question, Meng. The paper shows they tested it against Bendset, which is supposed to be more industrial use cases, so it suggests the approach is more robust than just running it on clean public data.
Tom: Exactly. They even found near zero mean absolute error for operations like Join and Aggregate operators in their results table.
Lu: So the core idea is this structured pipeline—bounding the search space first, then using those local performance models to refine the query toward those specific CPU time targets.
Jane: That’s a lot of complexity managed by a very smart search strategy rather than just brute force generation.
Meng: It sounds like they solved the problem of generating realistic workloads without having to manually craft every single complex query from scratch.
Tom: Right. The implication is that we can generate workloads that are way closer to what users actually do, which means our performance testing becomes much more useful for real system tuning.
Jane: It’s a step toward making synthetic data genuinely representative of how databases behave in the wild, and they did it using this new approach called ResQ.
More episodes
- The day in conversation for 2026-12-05
- Daily Summary for 2026-12-05
- 2607.26500-Multi-Decoder OneRec: Controllable Generative Retrieval for Multi-Objective Industrial Recommendation
- 2607.27976-Load balancing in parallel infinite-server queues with action delay via phase representation
- 2607.28574-Finite Pinwheel Covering
- 2608.07026-PyFlow: An Inter-procedural Static Analysis Framework for Python
- 2608.09305-Dilatations of categories, via their lean formalization
- 2608.16406-SATisfying the High School Identities but not Wilkie's Identity
- 2609.02062-SPAR: Enhancing Industrial-Scale Generative POI Recommendation via Real-World Spatial Perception
- 2609.03661-Point&Spawn: Mid-Air Reference-Free Object Instantiation Using Gaze and Hand Gestures in Extended Reality