arXiv:2605.31097cs.DBcs.AI2026-05

用大模型按需生成匹配工作负载的定制化数据库,代码量仅为主流数据库的3%。

SpecDB: LLM-Generated Customized Databases via Feature-Oriented Decomposition

论文配图:SpecDB: LLM-Generated Customized Databases via Feature-Oriented Decomposition
图 1 · 摘自论文原文
  • 通过大模型将工作负载描述转化为模块化实现方案,构建可定制数据库
  • 在TPC-C测试中10仓库配置下tpmC达130,错误率为0,代码量仅为主流数据库的3%
  • 支持跨系统技术融合,适合追求极致性能与轻量化部署的研发团队

主流关系型数据库在各类部署中提供统一的功能集,但实际工作负载仅使用其中一小部分子系统。本文探讨是否可按需生成功能集与目标工作负载匹配的数据库。提出SpecDB系统,利用大语言模型(LLM)合成定制化关系型数据库。调研9个生产系统,将其分解为10个功能模块,每个模块进一步划分为实现变体。为捕捉模块间依赖关系(包括不相连子树间的协同设计),采用FODA特征模型并引入协作边,形成依赖图DBGraph。SpecDB通过分层模块构建管道实现DBGraph:每个模块由专用子代理(主代理、测试代理、架构代理)生成、验证并集成,再由精炼代理基于只读源码和用户提供的精炼套件迭代修复与调优。配套选择组件将自然语言工作负载描述转化为实现变体,实现从描述到可部署数据库的端到端流程。在TPC-C测试中,生成数据库(23,779行Rust代码)在1和10仓库配置下60分钟运行零错误;10仓库时tpmC=130,优于PostgreSQL的128和MySQL的127,延迟相当,代码规模仅为它们的约3%。因代理操作于模块规范层面而非产品源码,理论上可跨系统边界组合技术。随着大模型成本下降,针对特定工作负载生成专用数据库正变得简单可行。

原文摘要 · Abstract (English)

Mainstream relational databases ship a uniform feature set across deployments, although individual workloads exercise only a fraction of the available subsystems. We investigate whether a database can instead be generated on demand with a feature set matched to the target workload. We present SpecDB, a system that uses large language models (LLMs) to synthesize customized relational databases. We survey 9 production systems and decompose them into 10 functional modules, each further divided into implementation variants. To capture cross-module dependencies, including cases where implementations in disjoint subtrees must be co-designed, we adopt the FODA feature model and extend it with a cooperate edge, yielding a dependency graph DBGraph. SpecDB operationalizes DBGraph through a layered module-construction pipeline in which each module is generated, validated, and integrated by a dedicated subagent (driven by three inner agents: Main, Tester, Architect), and a Refining Agent that iteratively repairs and tunes the assembled database against a user-supplied refining harness with read-only access to existing database source code. A companion selection component translates a natural-language workload description into a set of implementation variants, providing an end-to-end pipeline from workload description to deployable database. We evaluate SpecDB on TPC-C with BenchmarkSQL. The generated database (23,779 lines of Rust) completes 60-minute TPC-C at 1 and 10 warehouses with zero errors. At 10 warehouses it reaches tpmC=130, compared to 128 for PostgreSQL and 127 for MySQL, with comparable latency at ~3% of their code size. Because the agent operates at module-specification level rather than product source, it can in principle combine techniques across system boundaries. Paired with falling LLM costs, generating a purpose-built database for a target workload is becoming straightforward.

数据库生成大模型应用轻量化系统自动化构建

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。