pgrust.comยท29 october 2026

Programming at Light Speed: Building the Gravity Query Engine

Image for the article: Programming at Light Speed: Building the Gravity Query Engine
Image via pgrust.com

The pgrust v0.4-beta release introduces Gravity, a new query engine that achieves up to 3x faster performance than ClickHouse on ClickBench benchmarks while maintaining full Postgres SQL dialect and type system support. Gravity utilizes a multi-stage compiler pipeline that progressively lowers a high-level Postgres plan down to raw assembly, generating optimal machine code at runtime. Developers used Claude to write standalone, heavily optimized Rust programs against columnar storage crates to establish hardware speed limits and guide query compiler optimizations. The architecture structures query execution across distinct pipelines and breakers to efficiently handle filtering, aggregation, and sorting tasks.