Skip to main content
CenXiv.org
此网站处于试运行阶段,支持我们!
我们衷心感谢所有贡献者的支持。
贡献
赞助
cenxiv logo > cs > arXiv:2507.06192v1

帮助 | 高级搜索

计算机科学 > 数据库

arXiv:2507.06192v1 (cs)
[提交于 2025年7月8日 ]

标题: SQLBarber:一个利用大型语言模型生成定制化和现实SQL工作负载的系统

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

Authors:Jiale Lao, Immanuel Trummer
摘要: 数据库研究和开发通常需要大量SQL查询用于基准测试。然而,由于隐私问题,获取真实世界的SQL查询具有挑战性,现有的SQL生成方法在定制化和满足现实约束方面存在局限。为了解决这个问题,我们提出了SQLBarber,一个基于大型语言模型(LLMs)的系统,用于生成定制化和现实的SQL工作负载。SQLBarber(i)消除了用户预先手动构建SQL模板的需要,同时提供了接受自然语言规范来约束SQL模板的灵活性,(ii)能够高效扩展以生成符合任何用户定义成本分布(例如基数和执行计划成本)的大规模查询,(iii)利用Amazon Redshift和Snowflake的执行统计信息,推导出反映现实世界查询特征的SQL模板规范和查询成本分布。SQLBarber引入了(i)一种声明式接口,使用户能够轻松生成定制化的SQL模板,(ii)一个由自校正模块增强的LLM驱动的管道,该模块根据查询成本对SQL模板进行分析、优化和修剪,以及(iii)一个贝叶斯优化器,以高效探索不同的谓词值并识别一组满足目标成本分布的查询。我们基于Snowflake和Amazon Redshift的真实统计数据构建并开源了十个不同难度级别和目标查询成本分布的基准。这些基准上的大量实验表明,SQLBarber是唯一能够生成定制化SQL模板的系统。与现有方法相比,它将查询生成时间减少了1到3个数量级,并显著提高了与目标成本分布的一致性。
摘要: 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.
主题: 数据库 (cs.DB) ; 人工智能 (cs.AI); 计算与语言 (cs.CL); 机器学习 (cs.LG)
引用方式: arXiv:2507.06192 [cs.DB]
  (或者 arXiv:2507.06192v1 [cs.DB] 对于此版本)
  https://doi.org/10.48550/arXiv.2507.06192
通过 DataCite 发表的 arXiv DOI

提交历史

来自: Jiale Lao [查看电子邮件]
[v1] 星期二, 2025 年 7 月 8 日 17:20:34 UTC (820 KB)
全文链接:

获取论文:

    查看标题为《》的 PDF
  • 查看中文 PDF
  • 查看 PDF
  • HTML(实验性)
  • TeX 源代码
  • 其他格式
查看许可
当前浏览上下文:
cs.DB
< 上一篇   |   下一篇 >
新的 | 最近的 | 2025-07
切换浏览方式为:
cs
cs.AI
cs.CL
cs.LG

参考文献与引用

  • NASA ADS
  • 谷歌学术搜索
  • 语义学者
a 导出 BibTeX 引用 加载中...

BibTeX 格式的引用

×
数据由提供:

收藏

BibSonomy logo Reddit logo

文献和引用工具

文献资源探索 (什么是资源探索?)
连接的论文 (什么是连接的论文?)
Litmaps (什么是 Litmaps?)
scite 智能引用 (什么是智能引用?)

与本文相关的代码,数据和媒体

alphaXiv (什么是 alphaXiv?)
CatalyzeX 代码查找器 (什么是 CatalyzeX?)
DagsHub (什么是 DagsHub?)
Gotit.pub (什么是 GotitPub?)
Hugging Face (什么是 Huggingface?)
带有代码的论文 (什么是带有代码的论文?)
ScienceCast (什么是 ScienceCast?)

演示

复制 (什么是复制?)
Hugging Face Spaces (什么是 Spaces?)
TXYZ.AI (什么是 TXYZ.AI?)

推荐器和搜索工具

影响之花 (什么是影响之花?)
核心推荐器 (什么是核心?)
IArxiv 推荐器 (什么是 IArxiv?)
  • 作者
  • 地点
  • 机构
  • 主题

arXivLabs:与社区合作伙伴的实验项目

arXivLabs 是一个框架,允许合作伙伴直接在我们的网站上开发和分享新的 arXiv 特性。

与 arXivLabs 合作的个人和组织都接受了我们的价值观,即开放、社区、卓越和用户数据隐私。arXiv 承诺这些价值观,并且只与遵守这些价值观的合作伙伴合作。

有一个为 arXiv 社区增加价值的项目想法吗? 了解更多关于 arXivLabs 的信息.

这篇论文的哪些作者是支持者? | 禁用 MathJax (什么是 MathJax?)
  • 关于
  • 帮助
  • contact arXivClick here to contact arXiv 联系
  • 订阅 arXiv 邮件列表点击这里订阅 订阅
  • 版权
  • 隐私政策
  • 网络无障碍帮助
  • arXiv 运营状态
    通过...获取状态通知 email 或者 slack

京ICP备2025123034号