What is Nostr?
Louis :emacs: /
npub1tp9…dzfn
2023-11-01 15:02:38

Louis :emacs: on Nostr: Just gave SurrealDB 1.0.0, one of the new Rust kids on the block, a try. Goal: ...

Just gave SurrealDB 1.0.0, one of the new Rust kids on the block, a try. Goal: compare performance to PostgreSQL.

Both databases were setup on the same machine (x86_64, 8 cores).

Data: a table with 50.000 small rows (~60bytes). One column is a INT value between NULL and 250.

The raw file size on both databases was below 9 MBs.

Query in Postgres:

select count(*) from objects where score > 100;


Query in SurrealDB:

select count() from objects
where score > 100
group all


The count result will be 22.000.

Here are the results after a few repeated executions:

No index:
Postgres: 28ms
SurrealDB: 801ms

With index:
Postgres: 12ms
SurrealDB: 620ms

Time for creating the index:
Postgres: 50ms
SurrealDB: 8.140ms

I'm kind of disappointed about the result, given the small table size. I can't see how SurrealDB would scale with bigger setups and wonder about the hype around it.

#surrealdb #postgresql #benchmark
Author Public Key
npub1tp9e9qhmc02khh3jzpn8vmqwhj3u25yw352ed2x87zs4e2ps2uwqhadzfn