mlsanityData to 14 Oct 2026

SQLBarber: A System Leveraging Large Language Models to Generate Customized and Realistic SQL Workloads

arXiv 2507.06192 ↗First posted 8 Jul 2025cs.DB cs.AI cs.CLcited by 4

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

  1. 2023A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questionscited by 1,601
  2. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
  3. 2024Hallucination is Inevitable: An Innate Limitation of Large Language Modelscited by 332
  4. 2021SMAC3: A Versatile Bayesian Optimization Package for Hyperparameter Optimizationcited by 230
  5. 2018Statistical Aspects of Wasserstein Distancescited by 203
  6. 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 187
  7. 2023GPTuner: A Manual-Reading Database Tuning System via GPT-Guided Bayesian Optimizationcited by 29
  8. 2021DB-BERT: a Database Tuning Tool that "Reads the Manual"cited by 19
  9. 2024LLM-R2: A Large Language Model Enhanced Rule-based Rewrite System for Boosting Query Efficiencycited by 16
  10. 2024E2ETune: End-to-End Knob Tuning via Fine-tuned Generative Language Modelcited by 9
  11. 2025QUITE: A Query Rewrite System Beyond Rules with LLM Agentscited by 8
  12. 2024Is Large Language Model Good at Database Knob Tuning? A Comprehensive Experimental Evaluationcited by 5
3 more
  1. 2023Real-time Workload Pattern Analysis for Large-scale Cloud Databasescited by 4
  2. 2024Blueprinting the Cloud: Unifying and Automatically Optimizing Cloud Data Infrastructures with BRAD -- Extended Versioncited by 3
  3. 2023Testing Database Engines via Query Plan Guidancecited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 4.

4 papers.