Skip to content

perf(conversations): Find child agents by parent in subtree reads - #3005

Merged
BYK merged 1 commit into
mainfrom
perf/subtree-parent-lookup
Nov 9, 2026
Merged

BYK merged 1 commit into
mainfrom
perf/subtree-parent-lookup

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

conversationSubtree now checks the root with (child.root_conversation_id || '') = tree.root_conversation_id. The expression is not an index condition, so each recursive step finds children by parent_conversation_id and checks the root as a filter. || '' keeps null as null, so the same Conversations match.

The list usage test now adds a child that links to the root by parent but has another root, and checks that it stays out of the root's totals.

Refs #2998

via @BYK.

--

View Session [Sentry]

The subtree walk joined each child on its parent and its root. Postgres
can then look children up by root, which reads the whole tree for each
Conversation in it. Keep the root check out of the index condition, so
each step reads only the children of one Conversation.

Refs #2998

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 9, 2026 12:07pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

12 screenshot changes — 12 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Attachment · Desktop
Conversation Attachment · Desktop
Changed
Conversation Attachment · Mobile
Conversation Attachment · Mobile
Changed
Conversation Attachment Modal · Desktop
Conversation Attachment Modal · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Show 6 more changed screenshots
Conversation Details Watched Linked Work · Mobile
Conversation Details Watched Linked Work · Mobile
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Stop Active · Mobile
Conversation Stop Active · Mobile
Changed
Conversations Sections Collapsed · Desktop
Conversations Sections Collapsed · Desktop
Changed
Memories · Mobile
Memories · Mobile
Changed
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed

@sentry-junior
sentry-junior Bot added this pull request to stack #3007 November 9, 2026 12:39
@BYK
BYK enabled stacked auto-merge (squash) November 9, 2026 12:45
@BYK
BYK merged commit f35bcc6 into main Nov 9, 2026
48 checks passed
@BYK
BYK deleted the perf/subtree-parent-lookup branch November 9, 2026 12:49

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 6bab6770 Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant