Alex on Nostr: I never believed reactions should be replaceable. Poll votes are too hard to count if ...
I never believed reactions should be replaceable. Poll votes are too hard to count if they are regular.
I think replaceable events are very good if only for this:
"nostr_events_replaceable_idx" UNIQUE, btree (kind, pubkey) WHERE kind >= 10000 AND kind < 20000 OR (kind = ANY (ARRAY[0, 3]))
"nostr_events_parameterized_idx" UNIQUE, btree (kind, pubkey, d) WHERE kind >= 30000 AND kind < 40000
The fact they are unique makes lookups very fast.
If we allowed multiple, filters like `{ kinds: [0], authors: [alex, fiatjaf, patrick], limit: 3 }` wouldn't work right anymore and would have to be split into 3 different filters (now 3 individual REQs if only one filter per req).
I think replaceable events are very good if only for this:
"nostr_events_replaceable_idx" UNIQUE, btree (kind, pubkey) WHERE kind >= 10000 AND kind < 20000 OR (kind = ANY (ARRAY[0, 3]))
"nostr_events_parameterized_idx" UNIQUE, btree (kind, pubkey, d) WHERE kind >= 30000 AND kind < 40000
The fact they are unique makes lookups very fast.
If we allowed multiple, filters like `{ kinds: [0], authors: [alex, fiatjaf, patrick], limit: 3 }` wouldn't work right anymore and would have to be split into 3 different filters (now 3 individual REQs if only one filter per req).