Skip to content

perf(platform): notifying a comment's recipients costs about six statements per person #4712

Closed

Description

@yannickmonney

Summary

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

  1. added
    priority: low
    perf
    service: platform
    on Oct 10, 2026
  2. added
    agent-ready
    on Oct 29, 2026
  3. added a commit that references this issue on Oct 30, 2026
    4192251
  4. added a commit that references this issue on Oct 30, 2026
    75957e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyperfpriority: lowservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions