Louis 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
Published at
2023-11-01 15:02:38Event JSON
{
"id": "c9f34c2e322dd836139635789295e1235698554a996a6e1776decf5a047a56ca",
"pubkey": "584b9282fbc3d56bde321066766c0ebca3c5508e8d1596a8c7f0a15ca830571c",
"created_at": 1698850958,
"kind": 1,
"tags": [
[
"t",
"surrealdb"
],
[
"t",
"postgresql"
],
[
"t",
"benchmark"
],
[
"proxy",
"https://emacs.ch/users/louis/statuses/111335896431063872",
"activitypub"
]
],
"content": "Just gave SurrealDB 1.0.0, one of the new Rust kids on the block, a try. Goal: compare performance to PostgreSQL.\n\nBoth databases were setup on the same machine (x86_64, 8 cores).\n\nData: a table with 50.000 small rows (~60bytes). One column is a INT value between NULL and 250.\n\nThe raw file size on both databases was below 9 MBs.\n\nQuery in Postgres:\n\nselect count(*) from objects where score \u003e 100;\n\n\nQuery in SurrealDB:\n\nselect count() from objects \nwhere score \u003e 100\ngroup all\n\n\nThe count result will be 22.000.\n\nHere are the results after a few repeated executions:\n\nNo index:\nPostgres: 28ms\nSurrealDB: 801ms\n\nWith index:\nPostgres: 12ms\nSurrealDB: 620ms\n\nTime for creating the index:\nPostgres: 50ms\nSurrealDB: 8.140ms\n\nI'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.\n\n#surrealdb #postgresql #benchmark",
"sig": "74c36b078bafaadab290e055f6f81e6e25831af78f44bc8fda1d8f0fd0370e2457b073db5d4dd8de3696d92d2f86659a39b1ac79c8c73a4b076f06d82aa7decc"
}