For over 50 years, the database community has developed many successful engines to answer two questions: how can database systems run faster, and how to ensure their correctness? Our experience shows that performance depends on hardware and workloads. As both change over time, we repeatedly redesign and rebuild database systems, a time-consuming and expensive process. Correctness remains another challenge: recent studies continue to uncover wrong-answer bugs even in mature engines, despite years of development and testing. We present GenDB-V, a system that enables AI agents to synthesize database engines specialized to hardware and workloads for performance, and formally verified for correctness. It supports specialized implementations of SQL templates and general-purpose engines. First, we develop SQLSpec to formalize SQL semantics and deterministically construct fixed, implementation-agnostic synthesis targets. Second, we enable joint synthesis of fast code and formal proofs through storage-execution co-optimization, performance-first exploration, three-layer modular proofs that bridge low-level execution to SQLSpec semantics, and robust code synthesis that generalizes verified code beyond the given database state. Third, we verify the synthesized code and proofs against the fixed synthesis targets in an isolated pipeline, proving SQL correctness and program safety. We evaluate GenDB-V on TPC-H and SEC-EDGAR. On TPC-H SF100, the robust verified code is 5.69x faster than DuckDB and 2.22x faster than Umbra, and it remains the fastest system on attack databases built by the agents and on held-out databases built independently. Joint storage and query optimization raises the speedups to 22.0-61.3x, and a verified general-purpose engine outperforms both systems by 1.09-5.02x. Our experiments expose incorrect answers in both a human-built engine and a testing-based LLM synthesis method.
翻译:暂无翻译