Postgres was rewritten in Rust… and somehow passed every test - YouTube
Based on the video from Better Stack, here is a quick summary of pgrust:
What it is: An experimental rewrite of PostgreSQL in Rust.
Compatibility: It successfully passes all 46,066 official PostgreSQL regression queries, works with standard
psqlclients, and can boot directly from an existing Postgres 18.3 data directory.Architecture Shift: It replaces Postgres' traditional process-per-connection model with a thread-per-connection architecture using Rust threads, aiming to improve concurrency, reduce connection overhead, and provide built-in connection pooling.
Performance Claims: The project claims potential performance improvements of 50% to 300x for certain workloads, though developers and commenters remain skeptical, viewing it primarily as an AI-assisted experiment rather than a production-ready replacement.
You can check out the source code in the
malisper/pgrust: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests @GitHub
The goal is to make Postgres easier to change from the inside: keep the behavior Postgres-shaped, keep the real Postgres tests as the oracle, and use Rust plus AI-assisted programming to explore deeper server changes.
pgrust — postgres, rewritten in rust
Rebuilding Postgres for 300x faster analytics: batching, operator fusion, and SIMD - malisper.me
pgrust improves upon Postgres's traditional Volcano execution model—which processes data one row at a time with significant function call overhead—by applying three key techniques:- Batching: Processes rows in fixed-size batches (e.g., 1024 items at a time) using stack-allocated buffers. This eliminates per-row call overhead and avoids costly memory allocations, speeding up execution by ~2.7x over the basic Volcano model.
- Operator Fusion: Combines separate query plan operations (such as a sequential scan and an aggregation sum) into a single loop to eliminate array-copying overhead.
- SIMD (Single Instruction, Multiple Data): Utilizes hardware-level vector instructions to execute arithmetic operations across multiple values simultaneously, driving performance nearly 10x faster than the initial Volcano setup.
