Database research and the development of learned query optimisers rely heavily on realistic SQL workloads. Acquiring real-world queries is increasingly difficult, however, due to strict privacy regulations, and publicly released anonymised traces typically strip out executable query text to preserve confidentiality. Existing synthesis tools fail to bridge this training data gap: traditional benchmarks offer too few fixed templates for statistical generalisation, while Large Language Model (LLM) approaches suffer from schema hallucination fabricating non-existent columns and topological collapse systematically defaulting to simplistic join patterns that fail to stress-test query optimisers. We propose SynQL, a deterministic workload synthesis framework that generates structurally diverse, execution-ready SQL workloads. As a foundational step toward bridging the training-data gap, SynQL targets the core SQL fragment -- multi-table joins with projections, aggregations, and range predicates -- which dominates analytical workloads. SynQL abandons probabilistic text generation in favour of traversing the live database's foreign-key graph to populate an Abstract Syntax Tree (AST), guaranteeing schema and syntactic validity by construction. A configuration vector $Θ$ provides explicit, parametric control over join topology (Star, Chain, Fork), analytical intensity, and predicate selectivity. Experiments on TPC-H and IMDb show that SynQL produces near-maximally diverse workloads (Topological Entropy $H = 1.53$ bits) and that tree-based cost models trained on the synthetic corpus achieve $R^2 \ge 0.79$ on held-out synthetic test sets with sub-millisecond inference latency, establishing SynQL as an effective foundation for generating training data when production logs are inaccessible.


翻译:数据库研究与学习型查询优化器的开发高度依赖于真实的SQL工作负载。然而,由于严格的隐私法规,获取真实世界查询日益困难,而公开发布的匿名化轨迹通常为了保密性而剥离可执行的查询文本。现有的合成工具未能弥合这一训练数据缺口:传统基准测试提供的固定模板过少,难以进行统计泛化;而大语言模型方法则面临模式幻觉(虚构不存在的列)与拓扑崩溃(系统性地默认采用简化连接模式,无法对查询优化器进行压力测试)的问题。我们提出SynQL,一种确定性工作负载合成框架,用于生成结构多样、可立即执行的SQL工作负载。作为弥合训练数据缺口的基础步骤,SynQL针对核心SQL片段——包含投影、聚合与范围谓词的多表连接——这一分析型工作负载中主导的部分。SynQL放弃概率式文本生成,转而遍历实时数据库的外键图以填充抽象语法树,从而在构造上保证模式与语法的有效性。配置向量Θ提供了对连接拓扑(星型、链型、叉型)、分析强度与谓词选择性的显式参数化控制。在TPC-H与IMDb上的实验表明,SynQL能生成接近最大多样性的工作负载(拓扑熵H = 1.53比特),且在合成语料库上训练的基于树的成本模型在保留的合成测试集上达到R² ≥ 0.79,推理延迟低于毫秒级。这证实了SynQL在生产日志不可获取时,作为生成训练数据的有效基础。

0
下载
关闭预览

相关内容

「基于深度学习的 SQL 生成」2022研究综述
专知会员服务
28+阅读 · 2022年8月12日
可解释强化学习,Explainable Reinforcement Learning: A Survey
专知会员服务
132+阅读 · 2020年5月14日
基于MySQL Binlog的Elasticsearch数据同步实践
DBAplus社群
15+阅读 · 2019年9月3日
吐血整理!140种Python标准库、第三方库和外部工具都有了
炼数成金订阅号
16+阅读 · 2019年7月30日
工行基于MySQL构建分布式架构的转型之路
炼数成金订阅号
15+阅读 · 2019年5月16日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 4月23日
VIP会员
最新内容
无人机自主控制与人工智能:系统性综述
专知会员服务
6+阅读 · 今天7:25
巡飞弹与反无人机系统——现代战场的两大支柱
专知会员服务
2+阅读 · 今天6:54
《打造“黄金舰队”》57页报告
专知会员服务
1+阅读 · 今天6:52
《北约数字教官网络发展路径》128页报告
专知会员服务
1+阅读 · 今天6:33
ECCV 2026 | MIMFlow:MIM与归一化流统一图像生成
专知会员服务
6+阅读 · 6月25日
网状网络及其在军事领域的运用
专知会员服务
7+阅读 · 6月25日
无美国参与的欧洲战争方式(万字长文)
专知会员服务
8+阅读 · 6月25日
《国防领域敏感性分析白皮书》
专知会员服务
9+阅读 · 6月25日
综述 | 从问答到任务完成:Agent系统与Harness设计
专知会员服务
10+阅读 · 6月24日
Agentic RL:框架、实践与长程智能体训练
专知会员服务
10+阅读 · 6月24日
相关VIP内容
「基于深度学习的 SQL 生成」2022研究综述
专知会员服务
28+阅读 · 2022年8月12日
可解释强化学习,Explainable Reinforcement Learning: A Survey
专知会员服务
132+阅读 · 2020年5月14日
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员