Anže on Nostr: I've improved the performance of the starter packs list query from about 200ms to ...
I've improved the performance of the starter packs list query from about 200ms to 2ms. 🎉
The trick was to stop dynamically computing the number of accounts in a starter pack and instead precompute it in a column.
A bit more work on each update, but worth it!
Published at
2025-10-11 09:23:55 UTCEvent JSON
{
"id": "71183bf6e0bc2b4ebef4d9e629319f0b85364e7c1726ec1750e6b830f804ff85",
"pubkey": "a39a91945320863e63212c3b4f06a13aa380f33aa231788cf172e6701ba657f4",
"created_at": 1760174635,
"kind": 1,
"tags": [
[
"imeta",
"url https://cdn.fosstodon.org/media_attachments/files/115/354/804/798/945/653/original/cf9114068356c21a.png",
"m image/png"
],
[
"proxy",
"https://fosstodon.org/@anze3db/115354804894669699",
"web"
],
[
"proxy",
"https://fosstodon.org/users/anze3db/statuses/115354804894669699",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://fosstodon.org/users/anze3db/statuses/115354804894669699",
"pink.momostr"
],
[
"-"
]
],
"content": "I've improved the performance of the starter packs list query from about 200ms to 2ms. 🎉\n\nThe trick was to stop dynamically computing the number of accounts in a starter pack and instead precompute it in a column.\n\nA bit more work on each update, but worth it!\nhttps://cdn.fosstodon.org/media_attachments/files/115/354/804/798/945/653/original/cf9114068356c21a.png\n",
"sig": "7c7790e7cb2eef458457972dbb54597badc97c32a8305d1ebcb773deabece13f779ee24fb7d96f886db44dba764e8b941ebc0f0d3c191624e1997242c947fab8"
}