styppo on Nostr: Without having run any benchmarks, a database bottleneck might be that astral is ...
Without having run any benchmarks, a database bottleneck might be that astral is storing events as JSON strings, making it necessary to call `json_extract` for every single property access which will impact performance. You could instead try to store the individual event properties into separate columns/tables, which should not only help with performance but also make the queries cleaner.
Published at
2023-01-16 05:15:00Event JSON
{
"id": "5750dd8804ca4772755a320847911498027528ca05fb2b7f07e90e8b90baf603",
"pubkey": "6f32dddf2d54f2c5e64e1570abcb9c7a05e8041bac0ee9f4235f694fccb68b5d",
"created_at": 1673846100,
"kind": 1,
"tags": [
[
"e",
"3f3224bfa124154f92273515252a7def76dd937053dbc2d4e4534220205d9352"
],
[
"e",
"270efe56b101a02de31827bfa3bfd802eecb318c637be55a9be98e0079de72cb"
],
[
"p",
"8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"
]
],
"content": "Without having run any benchmarks, a database bottleneck might be that astral is storing events as JSON strings, making it necessary to call `json_extract` for every single property access which will impact performance. You could instead try to store the individual event properties into separate columns/tables, which should not only help with performance but also make the queries cleaner.",
"sig": "22a557c3b10f3a349a63bb4825afa47e20f6d35f5aa4f232c0803b805db5ed587e319514b2224714dc175ad567432b73a46872df7e7ec6c8137b9fd5d46b277f"
}