JetStream: Generating Verified Query Accelerators for Existing Database Systems

Agent Autonomous Workflows AI Systems and Hardware Text-to-Code
2026年10月14日
近期研究表明,大语言模型(LLM)能够为固定工作负载合成高度专业化的数据库系统;但这类系统需完全替换数据库管理系统(DBMS)的原生存储层,并假设数据是静态的:用户必须迁移现有数据,往往不得不放弃即席查询(ad-hoc queries),且一旦数据发生变更,加速效果即告失效。本文提出 JetStream 系统,其核心思路并非构建替代性数据库,而是生成面向特定查询的加速器,以扩展已有 DBMS 的能力。给定一组参数化查询模板,JetStream 采用分阶段的智能体(agentic)工作流,自动生成可直接在 DBMS 原生表上运行的加速器;这些加速器可维护自定义的辅助状态,而 DBMS 本身仍全面负责数据存储、事务处理、故障恢复,以及所有非加速查询的执行。该系统依托一个固定、与底层引擎无关的基础框架(substrate),该框架统一处理各 DBMS 引擎特有的接入点(hooks),并在写入操作下确保辅助状态与主数据之间保持事务一致性。JetStream 可生成两类加速器:一类是经测试验证的加速器(tested accelerators),允许采用任意优化技术,并通过差分测试(differential testing)进行正确性验证;另一类是经形式化验证的加速器(verified accelerators),其在性能上略有妥协,但能提供机器可检查的数学证明,确保返回的每一个查询结果均严格满足由原始 SQL 语义导出的可信规范。在 TPC-H 基准测试中(缩放因子 SF=20),JetStream 相较 DuckDB 实现了 315 倍的几何平均读取速度提升(其中经形式化验证的加速器达 93 倍);即便在每秒持续更新 10,000 行数据的高压力流式写入场景下,其加速性能仍可稳定维持在 120 倍水平。
Recent work has shown that LLMs can synthesize highly specialized database systems for fixed workloads, but these systems replace the DBMS's native storage and assume static data: users must migrate their data, often give up ad-hoc queries, and lose acceleration once the data changes. We present JetStream, which instead generates query-specific accelerators that extend an existing DBMS. Given a set of parametrized query templates, a staged agentic workflow synthesizes accelerators that run directly over the DBMS's native tables and may maintain custom auxiliary state, while the DBMS remains responsible for storage, transactions, recovery, and all other queries. A fixed, engine-neutral substrate handles engine-specific hooks and keeps auxiliary state transactionally consistent under writes. JetStream generates two kinds of accelerators: tested accelerators, which may use any optimization and are validated by differential testing, and verified accelerators which trade some performance for a machine-checked proof that every answer satisfies a trusted specification derived from the SQL. On TPC-H at SF=20, JetStream achieves a $315 \times$ geomean read speedup over DuckDB ($93 \times$ verified) and retains $120 \times$ under a continuous update stream of 10,000 modified rows per second.
许愿