SQLBarber: A System Leveraging Large Language Models to Generate Customized and Realistic SQL Workloads
Not on the map. Why?
Abstract (arXiv)
Database research and development often require a large number of SQL queries for benchmarking purposes. However, acquiring real-world SQL queries is challenging due to privacy concerns, and existing SQL generation methods are limited in customization and in satisfying realistic constraints. To address this issue, we present SQLBarber, a system based on Large Language Models (LLMs) to generate customized and realistic SQL workloads. SQLBarber (i) eliminates the need for users to manually craft SQL templates in advance, while providing the flexibility to accept natural language specifications to constrain SQL templates, (ii) scales efficiently to generate large volumes of queries matching any user-defined cost distribution (e.g., cardinality and execution plan cost), and (iii) uses execution statistics from Amazon Redshift and Snowflake to derive SQL template specifications and query cost distributions that reflect real-world query characteristics. SQLBarber introduces (i) a declarative interface for users to effortlessly generate customized SQL templates, (ii) an LLM-powered pipeline augmented with a self-correction module that profiles, refines, and prunes SQL templates based on query costs, and (iii) a Bayesian Optimizer to efficiently explore different predicate values and identify a set of queries that satisfy the target cost distribution. We construct and open-source ten benchmarks of varying difficulty levels and target query cost distributions based on real-world statistics from Snowflake and Amazon Redshift. Extensive experiments on these benchmarks show that SQLBarber is the only system that can generate customized SQL templates. It reduces query generation time by one to three orders of magnitude, and significantly improves alignment with the target cost distribution, compared with existing methods.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 15 of its 43 references that are in the map. First posted on arXiv 8 Jul 2025.
Builds on
15 of 43 references.
References · 15
- 2023A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questionscited by 1,601
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2024Hallucination is Inevitable: An Innate Limitation of Large Language Modelscited by 332
- 2021SMAC3: A Versatile Bayesian Optimization Package for Hyperparameter Optimizationcited by 230
- 2018Statistical Aspects of Wasserstein Distancescited by 203
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 187
- 2023GPTuner: A Manual-Reading Database Tuning System via GPT-Guided Bayesian Optimizationcited by 29
- 2021DB-BERT: a Database Tuning Tool that "Reads the Manual"cited by 19
- 2024LLM-R2: A Large Language Model Enhanced Rule-based Rewrite System for Boosting Query Efficiencycited by 16
- 2024E2ETune: End-to-End Knob Tuning via Fine-tuned Generative Language Modelcited by 9
- 2025QUITE: A Query Rewrite System Beyond Rules with LLM Agentscited by 8
- 2024Is Large Language Model Good at Database Knob Tuning? A Comprehensive Experimental Evaluationcited by 5
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026GenDB: The Next Generation of Query Processing -- Synthesized, Not Engineeredcited by 1
- 2026Business Logic-Driven Text-to-SQL Data Synthesis for Business Intelligencecited by 0
- 2026Test-Time Optimization of Physical Query Plans with LLMscited by 0
- 2026WAter: A Workload-Adaptive Knob Tuning System based on Workload Compressioncited by 0
- 2026WAter: A Workload-Adaptive Knob Tuning System based on Workload Compression28 Mar 2026
- 2026GenDB: The Next Generation of Query Processing -- Synthesized, Not Engineered2 Mar 2026
- 2026Test-Time Optimization of Physical Query Plans with LLMs11 Feb 2026
- 2026Business Logic-Driven Text-to-SQL Data Synthesis for Business Intelligence20 Jan 2026