DBRepro: Automated Database Synthesis via a Hybrid Constraint-Solving Approach for Reproducing Slow Queries
Open Access
- 7 October 2026
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 3754-3766
Abstract
Slow queries frequently cause severe performance bottlenecks in Database Management Systems (DBMSs). Due to the severe risk of exacerbating online resource contention, diagnosing their root causes online is usually infeasible; offline diagnosis has thus become the de facto approach. However, strict data privacy regulations prohibit accessing original user data. Therefore, synthesizing a proxy database, one that induces the query optimizer to generate identical physical execution plans as in production, from non-intrusive metadata, is critical for reproducing and diagnosing slow queries offline. Achieving high-fidelity reproduction demands satisfying both global statistical distributions and exact local cardinality constraints. Existing works fundamentally fail to achieve both simultaneously: data-driven approaches cannot enforce strict local cardinalities, whereas workload-aware approaches severely distort the overall data distribution, misleading the optimizer into divergent execution plans. To bridge this gap, we introduce DBRepro, an automated end-to-end database synthesis framework that synergistically integrates data-driven and workload-aware methodologies. DBRepro formulates database generation as a constrained distribution synthesis problem. It initializes a global data distribution from lightweight column statistics, extracts execution constraints from the target queries, and progressively adjusts the distribution to satisfy these constraints, ensuring the global distribution is maximally preserved while exact local cardinalities are strictly enforced. Extensive evaluations on the TPC-H and SSB benchmarks demonstrate that DBRepro outperforms state-of-the-art baselines across comprehensive fidelity metrics. Compared to the data-driven baseline, it reduces cardinality error by up to 20.3% while maintaining identical plan consistency. Against a workload-aware baseline, it reproduces 15% more consistent execution plans and lowers the latency proportion error by 21.5%. Furthermore, we validate its industrial practicality on a nearly 1 TB real-world dataset from a specific industrial sector, managed by KingbaseES, successfully reproducing the execution performance of complex slow queries with high fidelity.Keywords
Funding Information
- National Natural Science Foundation of China (62472429)
- National Natural Science Foundation of China (62441230)
- National Natural Science Foundation of China (62461146205)
This publication has 46 references indexed in Scilit:
- $\text {Touchstone}^{+}$ : Query Aware Database Generation for Match Operators2024
- Many-Objective Test Database Generation for SQL2020
- Incremental test data generation for database queriesAutomated Software Engineering, 2017
- BDGS: A Scalable Big Data Generator Suite in Big Data Benchmarking2014
- MyBenchmark: generating databases for query workloadsThe VLDB Journal, 2014
- UpSizeR: Synthetically scaling an empirical relational databaseInformation Systems, 2013
- CoDS: A Representative Sampling Method for Relational DatabasesLecture Notes in Computer Science, 2013
- A Data Generator for Cloud-Scale BenchmarkingLecture Notes in Computer Science, 2011
- Qex: Symbolic SQL Query Explorer2010
- The Star Schema Benchmark and Augmented Fact Table Indexing2009