Postgres rewritten in Rust v0.2, now faster than Postgres and ClickHouse

malisper1 pts0 comments

Release pgrust v0.2: Now faster than Postgres and Clickhouse 路 malisper/pgrust 路 GitHub

//releases/show" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

//releases/show;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

malisper

pgrust

Public

Notifications<br>You must be signed in to change notification settings

Fork<br>147

Star<br>3.9k

pgrust v0.2: Now faster than Postgres and Clickhouse

Latest

Latest

Compare

Choose a tag to compare

Sorry, something went wrong.

Filter

Loading

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

No results found

View all tags

malisper

released this

30 Jul 15:36

v0.2-release

3ad28fd

Releasing pgrust v0.2. This is the fast version of pgrust, our Postgres rewrite from C to Rust. pgrust v0.2 is faster than Postgres and Clickhouse.

Performance

Measured on c8g.4xlarge (AWS Graviton4) against PostgreSQL 18.3.

On the ClickBench combined score, pgrust scored 18.5% faster than ClickHouse

and hundreds of times faster than PostgreSQL. This was using pgrcolumnar,

pgrust's builtin columnar layout.

On sysbench-oltp, pgrust achieved 30% higher throughput than Postgres 18.3 on

read-only workloads at 300GB scale.

These runs were reviewed independently by Greg Smith , author of

PostgreSQL 9.0 High Performance.

Two honest caveats. We had previously reported that pgrust was over 50%

faster than Postgres. On Kubernetes we measure a larger OLTP gap, 50-60%

rather than 30%, and we have not isolated why the same binaries behave

differently there than on bare EC2, so we quote the lower number. Second, the

binaries we publish are generic for their architecture. The benchmark numbers

come from builds tuned for Graviton4 (-Ctarget-cpu=neoverse-v2), so you

will not reproduce them exactly from a download.

Benchmarks and durability settings are unchanged from a default install:

fsync is on. The harnesses are in benchmarks/ so you can

run them yourself.

What's new in v0.2

Executor

A new vectorized, push-based executor with JIT compilation.

A JIT that emits machine code directly, cutting compile time from ~50ms to

~5碌s. It currently targets neoverse-v2 (Graviton4) only.

A cache-optimized hash table that adapts its strategy to maximize L1/L2

hits. Used for aggregations today.

Parallelism

Threads instead of processes, for both connections and parallel query.

A query scheduler, new to Postgres. Queries get a priority, and

long-running queries have theirs lowered, so heavy queries interfere less

with fast ones.

Parallel query rebuilt around work stealing: idle threads are assigned

dynamically to speed up queries already in flight.

Storage

pgrcolumnar, a column-oriented format with dictionary encoding and

several other compression schemes.

Pipelined fsync. A worker releases its locks after calling fsync but

before it completes. This is safe because the query is not acknowledged,

and none of its effects are observable, until the fsync finishes. It

speeds up highly contended updates by 30-50x.

Other

A built-in OOM killer. Near the machine's memory limit, pgrust picks a

worker to kill, so that one query dies and the server itself can keep

running.

Executable layout optimized with PGO

Assets

Loading

Uh oh!

There was an error while loading. Please reload this page.

-->

馃殌<br>dolezvo1 reacted with rocket emoji

All reactions

馃殌<br>1 reaction

1 person reacted

You can鈥檛 perform that action at this time.

pgrust postgres faster query clickhouse search

Related Articles