Repository navigation
Commit 9c27a0f
perf(relay): write a kind:9000 batch in one membership transaction
A put-user naming many people made one transaction, one membership lock
and five or six round trips per person, plus a policy query and a
channel-type read per person.
buzz-db gains put_members: one transaction and lock, one read of every
involved role, the owner count only when a demotion needs it, and one
UNNEST upsert with RETURNING. People are decided in tag order, each
seeing the roles earlier ones were given (including the actor's own)
and the owners they add or remove, so the answers match one write per
person. put_member is put_members with one person, so the admission and
last-owner rules keep one implementation; it replaces
put_member_with_prior_role.
Validation reads every third-party target's channel_add_policy in one
query, and apply reads the channel type once for all member-added
notifications.
Co-authored-by: mbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz>
Signed-off-by: Bradley Axen <[email protected]>1 parent 32a129d commit 9c27a0f
3 files changed
Lines changed: 471 additions & 167 deletions
0 commit comments