TRANSMISSION // 2611.02779v2

Can AI build database engines that are both fast and correct?

Source published

GenDB-V uses AI agents to create database code alongside formal proofs. Its tests show promising speedups, while highlighting limits around SQL coverage, changing data and trusted software.

AI-generated conceptual illustration for Can AI build database engines that are both fast and correct?
AI-generated conceptual illustration; not documentary evidence.

Database engines must return the right answer while making good use of hardware. GenDB-V explores whether AI agents can help build specialized engines without relying on testing alone to establish correctness.

A database query can look simple and still be difficult to get right. SQL has rules for missing values, duplicate rows, errors and results whose order is not fully specified. Meanwhile, the fastest way to run a query can depend on the machine and the data. That creates two challenges: improving speed without breaking the rules, and checking correctness across inputs that were not part of a test set.

In GenDB-V: AI-Generated and Formally Verified Database Systems, Jiale Lao and Immanuel Trummer describe a system in which AI agents generate database code and mathematical proofs together. The central idea is to let agents choose how to store data and execute queries, but not let them define what counts as a correct answer.

Set the rules before generating code

GenDB-V first translates SQL queries and database schemas into fixed verification targets using SQLSpec, the authors’ formal description of a supported subset of SQL. The specification accounts for features including NULL values, duplicate rows, runtime errors and ordering ties. It is based on PostgreSQL semantics, but does not cover every SQL feature: for example, the paper says window functions are currently unsupported.

Agents then generate code and proofs. Those proofs must connect the implementation to SQLSpec’s requirements. For customized storage, the system also checks that the storage preserves the original data. Finally, an isolated verification pipeline checks the result; code is admitted only if its proofs pass. The work uses Verus, a tool for verifying Rust programs, together with the Z3 solver.

This is different from checking a handful of query outputs. Tests can reveal errors in the cases they run, but cannot by themselves show that a program is correct on every input covered by a specification. A proof can establish that guarantee within its defined scope—provided the specification and verification machinery are themselves sound.

Speed and generalization

The authors evaluate GenDB-V on two analytical workloads: TPC-H and SEC-EDGAR. In one setting, agents optimize query code over ordinary column arrays; in another, they co-design storage and query execution. They also build a general-purpose engine for the SQL subset supported by SQLSpec.

For robust, verified query code on TPC-H at scale factor 100, the paper reports geometric-mean speedups of 5.69 times over DuckDB and 2.22 times over Umbra on the given database. “Robust” here refers to a further step in which agents look for weaknesses in their own code and revise it to handle changes in data and query parameters. The authors also test on attack databases created by agents and held-out databases generated independently. In total execution time, the robust code was fastest among the tested systems on both groups.

When agents can optimize both storage and query execution for a particular database state, the paper reports larger speedups: 22.0–61.3 times over the two comparison systems across the benchmarks. A separate verified general-purpose engine, designed to handle queries across the supported SQL subset, outperformed DuckDB and Umbra in the reported workload-time comparisons, with speedups ranging from 1.09 to 5.02 times.

These results come with important qualifications. The large gains from joint optimization are tied to the database state used during synthesis; the paper says applying the robustness step to the general-purpose engine remains future work. Even the robust code is not fastest on every valid database. For example, the authors report cases where it scans data while Umbra can skip it using metadata. The system’s correctness claim also depends on a trusted foundation that includes SQLSpec, the SQL-to-specification translation, Verus, Z3, the compiler and runtime, the operating system and hardware.

The authors report finding incorrect answers in a tested version of Umbra and in a testing-based AI synthesis method. Those examples show how bugs can escape testing, but they do not establish that the comparison systems are generally unreliable. The paper’s results are also limited to two benchmarks, a particular machine, a specific model and settings, and a defined SQL subset. Synthesis itself has nontrivial costs: the paper reports thousands of dollars for its main configurations.

GenDB-V is presented as a research prototype and a demonstration that performance tuning and formal proofs can be combined in AI-generated database code. The source identifies the work with a 2027 Proceedings of the VLDB Endowment reference, but the arXiv record supplied here is version 2, dated November 2026, and lists placeholder volume pages and DOI. That record alone does not establish the final publication details or independent replication. The results are promising evidence for this approach—not a guarantee that AI can yet generate fast, verified database systems for every workload.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.