GenDB: The Next Generation of Query Processing — Synthesized, Not Engineered
Jiale Lao, Immanuel Trummer · 2026
Read GenDB: The Next Generation of Query Processing — Synthesized, Not Engineered by Jiale Lao, Immanuel Trummer (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-02081.txt.
Introduction
Jiale Lao and Immanuel Trummer argue that future query engines should be synthesized per query, not engineered once for all. Their 2026 work observes that hand-built engines strain to keep pace with new techniques and user needs. Internal complexity also makes those engines hard to extend or rebuild cheaply.
Their proof of concept, GenDB, uses language models to generate execution code for each incoming query. The generated code is optimized for the specific data, workload, and hardware at hand. An early prototype runs a multi-agent setup built on a commercial coding agent. Tests use a classic benchmark plus a new one designed to reduce leakage from model training data. Against five established engines, the synthesized approach performs significantly better in their evaluation, with limits and extensions discussed.
Catalog record
| CREATOR | Jiale Lao, Immanuel Trummer |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 34603 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2603.02081
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
GenDB: The Next Generation of Query Processing — Synthesized, Not Engineered Jiale Lao, Immanuel Trummer Abstract . 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. PVLDB Artifact Availability: The source code, data, and/or other artifacts have been made available at https://github.com/SolidLao/GenDB . 1. Introduction A large number of Database Management Systems (DBMSs) have been developed over the decades ( 38 ; 45 ; 39 ; 48 ; 65 ; 11 ; 7 ) . These systems feature complex designs and well-engineered implementations to achieve high performance and rich functionality. However, new techniques and user requirements evolve rapidly. As a result, existing systems often cannot keep pace and must rely on external extensions or even the development of new systems from scratch. For example, PostgreSQL performs well for OLTP, but it is less effective for OLAP workloads, real-time analytics on time-series data, and workloads that require vector embedding storage and similarity search. Many extensions have been developed to add these capabilities to PostgreSQL ( 9 ; 54 ; 43 ) , and some extensions attempt to mitigate the architectural constraints of the original system (e.g., the page-oriented storage layout is inefficient for vector indexes ( 34 ) ). In addition, several purpose-built systems have been designed for these workloads and often achieve significantly higher performance ( 49 ; 62 ; 44 ; 39 ; 48 ; 7 ; 11 ) . Due to system complexity, extending database systems is difficult and often introduces incompatibility and system failures ( 20 ) . Alternatively, developing new systems requires substantial engineering effort and financial cost. Recently, more techniques have emerged, such as semantic query processing over multi-modal data, which has been integrated in some industrial systems ( 11 ; 7 ) , and GPU-native analytical processing that has shown better cost efficiency than traditional CPU-based processing ( 63 ) . For these and future techniques, should we continue extending existing systems (e.g., PostgreSQL), or should we design and implement new systems? Or is there another option? In this paper, we argue that recent advances in LLMs are starting to shape the next generation of query processing: generating query-specific execution code for each query, rather than continuously building, extending, and maintaining complex query engines. As a proof of concept, we present GenDB, an LLM-powered agentic system that generates instance-optimized and customized execution code tailored to specific data, workload, and hardware resources. Generating code per query offers unprecedented space for query optimization and extreme extensibility for integrating new techniques. We present one example below, and discuss more in Section 5 . Example 1.1. Query repetition is a key characteristic of real-world workloads: in 50% of Amazon Redshift clusters, 80% of queries exactly repeat previously observed queries ( 61 ) . Both short- and long-running queries repeat, and long-running queries almost always recur across clusters, as they correspond to regular transformation or analytical tasks ( 61 ) . GenDB is well suited for such workloads because the upfront code generation cost can be amortized over many executions. For ad-hoc queries, GenDB can be combined with a traditional DBMS in a hybrid architecture: the traditional system handles one-off queries, while GenDB accelerates frequent queries. GenDB serves different users. For developers, it automatically generates instance-optimized execution code, whose correctness can be verified by manual inspection. For users without an SQL background, GenDB can be easily extended with a natural language interface, similar to conversational services deployed in production systems that typically do not provide correctness guarantees ( 8 ; 14 ; 50 ) . GenDB is an agentic system built on LLMs. It takes as input the database schema, natural language questions or SQL queries, and data, along with user configurations (e.g., optimization targets and budgets) and available resources (e.g., hardware resources or access to remote LLM APIs). GenDB first analyzes the workload and hardware to extract structured characteristics that guide subsequent design decisions. It then generates customized storage layouts and index structures. GenDB supports both standard relational data and extended data types, such as images and audio. Based on the workload analysis and storage design, GenDB generates resource-aware execution plans and produces executable code. It uses runtime feedback to iteratively optimize performance. After reaching the user-defined optimization targets or budgets, GenDB outputs the optimized storage structures, indexes, and one executable file per query, all tailored to the specific data, workload, and resources. We evaluate an early prototype of GenDB on OLAP workloads. We use queries from the TPC-H benchmark and also construct a new benchmark that is 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. By iteratively refining the code based on runtime feedback, GenDB eventually produces correct implementations that achieve significantly better performance. Currently, GenDB validates query correctness by comparing the generated query results with those produced by a traditional database system. When ground truth query results are not available, we recommend that human experts manually verify the generated code. This verification process is generally easier than implementing high-performance code or manually tuning query engines. For scenarios in which users do not have an SQL background and interact through a natural language interface, GenDB does not provide formal correctness guarantees, which is consistent with conversational services already deployed in production by Databricks ( 8 ) , BigQuery ( 14 ) , and Snowflake ( 50 ) . In our future research, we plan to develop additional safety mechanisms, reducing the chances of incorrect code. At the same time, advances in LLMs will help to improve code quality in general. Finally, we discuss the current limitations and outline future extensions and related research challenges. 2. Background and Related Work Compilation-Based Query Code Generation. The idea of generating customized code for efficient query processing is not new, and GenDB relates to prior work that uses compilation techniques to generate such code ( 5 ; 21 ) . HIQUE ( 21 ) generates