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): list reads behind everyday screens grow with the organization, not the page #4708
Several reads behind everyday screens grow with the organization rather than with the page. Found in the million-user analysis; each item verified on main at aa53363 (paths under services/platform/backend/).
Read
What it does now
Suggested fix
listThreads (domains/chat/threads.ts)
"Deliberately unpaginated", and every call reads the thread ids of all generations of the organization (generatingThreadIds, SELECT thread_id FROM app.generations WHERE org_id = …)
Keyset pages; join the user's threads to app.generations instead of an org-wide set
GET /chat/threads/:id/messages and the stream's settle (domains/chat/message-views.tslistMessageViews)
The whole thread, every message's parts
The existing tail reader (limit 200); the settle sends only the settled row
Members list (domains/members/service.ts:142)
A correlated count(*) FROM "passkey" per member, and the task actor directory and the inbox load the whole list for every member
A search or page endpoint; the passkey count only in the admin view
listProjects (domains/projects/service.ts:2772)
No limit; used by Home and the all-projects task views
Pages; visibility as a join instead of ANY(<ids>)
Org bell unreadCount and markAllRead (domains/notifications/service.ts:174-191, 215-235)
count(*) over all of the organization's notifications with a NOT EXISTS per row; read-all inserts one row per notification
A per-user read watermark
listMyNotifications
ORDER BY seq over indexes (user_id, org_id, created_at_ms) and (user_id, org_id, read, seq) — the full list sorts every row of the user
(user_id, org_id, seq DESC)
Home "assigned to me"
The filter is (${assigneeId}::text IS NULL OR t.assignee_id = ${assigneeId}) (domains/tasks/service.ts:3798), and tasks_assignee (org_id, assignee_type, assignee_id) (db/migrations/0009_tasks.sql:77) could not serve assignee_id = ? ORDER BY updated_at_ms on PG16 anyway (no skip scan), so the organization's tasks are walked by updated_at_ms
A separate branch for the assigned case; (org_id, assignee_id, updated_at_ms DESC) WHERE archived_at_ms IS NULL
Home "assigned to me": a statement of its own and the index (org_id, assignee_id, updated_at_ms DESC) WHERE archived_at_ms IS NULL. This item is worked on TALE-117, and its commit closes this issue.
Three items differ from the table above at feature-train9173785:
Item 2: the server's settle already sends one row, but the client re-reads the whole thread.
Item 4: project visibility is an array-overlap clause, and the ANY(<ids>) sits in the readers that take the project list.
Item 6: listMyNotifications is already paginated, but it has no (user_id, org_id, seq DESC) index.
Landed on the feature line: feature train #5184 merged into release/0.6 on 2026-10-31 by rebase, and this issue's change is commit 7616a50 (perf(platform): read assigned tasks through an index of their own, task TALE-117). It ships with Tale 0.6.0. GitHub closes an issue only for a commit on main, so the feature-train role closes it here.
Activity
tale-code-bot commentedon Oct 30, 2026
Split as triaged on TALE-117 (decision of 2026-10-30). Items 1-6 are now issues of their own, and item 7 stays here:
listThreads: keyset pages, with generations read per page. perf(platform): page the chat thread list and read generations per page #5153listProjects: pages, with visibility as a join. perf(platform): page listProjects and read visibility as a join #5156user_notifications (user_id, org_id, seq DESC)index. perf(platform): index user_notifications on (user_id, org_id, seq DESC) #5158(org_id, assignee_id, updated_at_ms DESC) WHERE archived_at_ms IS NULL. This item is worked on TALE-117, and its commit closes this issue.Three items differ from the table above at
feature-train9173785:ANY(<ids>)sits in the readers that take the project list.listMyNotificationsis already paginated, but it has no(user_id, org_id, seq DESC)index.Each split issue says so.
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
tale-code-bot commentedon Oct 31, 2026
Landed on the feature line: feature train #5184 merged into
release/0.6on 2026-10-31 by rebase, and this issue's change is commit 7616a50 (perf(platform): read assigned tasks through an index of their own, task TALE-117). It ships with Tale 0.6.0. GitHub closes an issue only for a commit onmain, so the feature-train role closes it here.perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
4 remaining items
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own
perf(platform): read assigned tasks through an index of their own