Read every board row's status in one query - #360
Merged
Conversation
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
force-pushed
the
board-status-in-one-read
branch
from
August 30, 2026 15:59
0afda2e to
93244d1
Compare
czpython
enabled auto-merge (squash)
August 30, 2026 15:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/streamrepeated them every couple of seconds. The row cap an app writes intolist_summariesis the symptom.Run.get_latest_for_subjectsreturns the driving run of every subject on the page in one statement, with its agent calls.get_subject_statusescomposes those into the sameSubjectStatusvalues 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_statusand bothget_status()methods are untouched, and the batch takes noworkflownarrowing — a board never asks for one.