arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.08021cs.DB
收藏

SynQL: 一种可控且可扩展的基于规则的SQL工作负载合成框架用于性能基准测试

SynQL: A Controllable and Scalable Rule-Based Framework for SQL Workload Synthesis for Performance Benchmarking

School of Technology, Dhirubhai Ambani University(德吉巴伊·安巴尼大学技术学院)

Kahan Mehta, Amit Mankodi

AI总结:

SynQL通过遍历数据库外键图生成结构多样且可执行的SQL工作负载,解决现有合成工具在训练数据缺口上的不足,通过配置向量控制连接拓扑和分析强度,实验表明其合成数据能有效训练成本模型。

摘要:

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

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑