You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(platform): notifying a comment's recipients costs about six statements per person #4712
Notifying the people a comment or mention concerns costs about six statements per recipient, inside the writer's transaction. Verified on main at aa53363 (services/platform/backend/domains/collab/service.ts).
Per recipient: the preference check (isNotificationAllowed, called per recipient at lines 413 and 1459), a scan of up to 100 unread rows to coalesce, an insert or update, an e-mail job with its epoch update, and an outbox hint. A comment on a task with many watchers holds its transaction (and the task's comment queue) for all of it.
Suggested fix
Read every recipient's preferences in one = ANY query, write the notifications in one multi-row statement, and emit one hint per batch.
Activity
perf(platform): notify a fan-out's recipients in one batch
perf(platform): notify a fan-out's recipients in one batch