Skip to content

Conversation reads recompute subtree aggregates #2998

Closed

Description

@sentry-junior

Conversation list and detail reads recompute jsonb aggregates over a Conversation's subtree on each request and poll:

  • sql/subtree.ts subtree aggregates
  • pi/sql-model-usage.ts sumModelUsage, which scans every assistant_call payload on a cache miss
  • the annotations read

Proposal (from the audit): write the subtree and model-usage totals to metrics when events are written, lengthen the cache TTL, and review the annotations query plan.

Part of the unbounded-read audit that followed #2940.

via @BYK.

--

View Session [Sentry]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions