Skip to content

Read every board row's status in one query - #360

Merged
czpython merged 2 commits into
mainfrom
board-status-in-one-read
Aug 30, 2026
Merged

Read every board row's status in one query#360
czpython merged 2 commits into
mainfrom
board-status-in-one-read

Conversation

@czpython

Copy link
Copy Markdown
Owner

Every app board asked the read side for one row's status at a time. A page of N subjects ran N driving-run queries, and each viewer's /stream repeated them every couple of seconds. The row cap an app writes into list_summaries is the symptom.

Run.get_latest_for_subjects returns the driving run of every subject on the page in one statement, with its agent calls. get_subject_statuses composes those into the same SubjectStatus values through the same _status, and the mounted board reads them once.

The wire does not change, and no app changes: every board and every board stream gets this as it stands.

One cost moves the other way. The batch loads agent calls for the whole page, so a board of parked rows now runs one call query where it ran none. The test that pinned "a parked row loads no agent calls" is replaced by the invariant that matters for a board: the query count does not grow with the number of rows.

get_subject_status and both get_status() methods are untouched, and the batch takes no workflow narrowing — a board never asks for one.

The board asked the read side for each row's status on its own, so a page of
N subjects ran N driving-run queries and each viewer's /stream repeated them
every couple of seconds. Run.get_latest_for_subjects now returns the driving
run of every subject on the page, with its agent calls, in one statement.
@czpython
czpython force-pushed the board-status-in-one-read branch from 0afda2e to 93244d1 Compare August 30, 2026 15:59
@czpython
czpython enabled auto-merge (squash) August 30, 2026 15:59
@czpython
czpython merged commit 835a9f8 into main Aug 30, 2026
1 check passed
@czpython
czpython deleted the board-status-in-one-read branch August 30, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant