arXiv:2603.02081cs.DBcs.AI2026-03被引 8

用大模型自动生成查询代码,让数据库系统不再依赖复杂引擎

GenDB: The Next Generation of Query Processing -- Synthesized, Not Engineered

  • 用大模型为每个查询动态生成定制化执行代码
  • 在TPC-H和新基准上性能超越DuckDB等主流引擎
  • 适合想快速构建高效查询系统的开发者与研究者

传统查询处理依赖人工优化的复杂引擎,但技术更新快、扩展困难且开发成本高。本文提出利用大语言模型(LLM)自动生成针对特定数据、负载和硬件资源的查询执行代码,以实现“合成”而非“工程”的下一代查询系统。我们构建了原型系统GenDB,基于Claude Code Agent作为多智能体核心,在OLAP场景下评估其表现。实验使用TPC-H基准查询,并设计新基准以减少大模型训练数据泄露风险。对比DuckDB、Umbra、MonetDB、ClickHouse和PostgreSQL等先进引擎,GenDB在多个指标上显著领先。文章还讨论了当前局限性及未来研究方向。

原文摘要 · Abstract (English)

Traditional query processing relies on engines that are carefully optimized and engineered by many experts. However, new techniques and user requirements evolve rapidly, and existing systems often cannot keep pace. At the same time, these systems are difficult to extend due to their internal complexity, and developing new systems requires substantial engineering effort and cost. In this paper, we argue that recent advances in Large Language Models (LLMs) are starting to shape the next generation of query processing systems. We propose using LLMs to synthesize execution code for each incoming query, instead of continuously building, extending, and maintaining complex query processing engines. As a proof of concept, we present GenDB, an LLM-powered agentic system that generates instance-optimized and customized query execution code tailored to specific data, workloads, and hardware resources. We implemented an early prototype of GenDB that uses Claude Code Agent as the underlying component in the multi-agent system, and we evaluate it on OLAP workloads. We use queries from the well-known TPC-H benchmark and also construct a new benchmark designed to reduce potential data leakage from LLM training data. We compare GenDB with state-of-the-art query engines, including DuckDB, Umbra, MonetDB, ClickHouse, and PostgreSQL. GenDB achieves significantly better performance than these systems. Finally, we discuss the current limitations of GenDB and outline future extensions and related research challenges.

数据库大模型查询优化自动生成

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