The ceiling is a thousand rows
A comment beside the member totals names their ceiling: tens of thousands of sets, and then it gets slow. The query under it has no range, and the API it calls stops at a thousand rows without saying so.
3 min readMicroGym · History stage
Open a member on the platform and the page shows what they have done: sessions attended, workouts logged, sets, total reps, total volume, the date of their latest session. Every number comes from one function. It asks the database for the member's sessions and for every set they have ever recorded, then adds them up in the browser.
A ceiling, written down
Adding up in the browser was a choice, and the function says so. The comment above it, added on 24 July 2026, gives the reason and the limit in three lines: the query layer has no sum or count over a filtered join, a member has tens of rows, and the work should move to a view or a database function if a member ever has tens of thousands. The anatomy row quoted that comment and called it a ceiling named rather than hidden. It is the right instinct. It names the wrong ceiling.
Where the ceiling actually is
The set query selects reps and weight where the member matches, and stops there. No range, no limit, no count. The hosted database API this platform calls has a maximum number of rows per request, and its default is one thousand. A request that matches more does not fail. It returns a thousand of them, in no stated order, with no error, and the code reads that as everything. The repository holds no configuration for that setting, so I read it from the live project on 11 November 2026: it is the default. The ceiling is not slowness at tens of thousands of sets. It is a wrong answer at one thousand and one.
A thousand is closer than it sounds. A set here is a row per member, per movement, per round. A session of six movements over three rounds writes eighteen of them, so a member who trains that way reaches a thousand in their fifty-sixth session, about a year of weekly visits. From then on Sets Logged reads exactly 1,000 and stays there, and total reps and total volume are sums over whichever thousand came back, while the member keeps training. No one is there yet: on the same day the most sets any member had recorded was 29. Nothing on the page would look broken. A round number is the only clue, and nobody reads a round number as a clue.
Why the comment missed it
The comment reasons about cost: how much work the browser does as the list grows. That is the failure a person expects, because it is the one they would feel. The row cap is not a cost. It is a contract the API keeps quietly, and it turns a slow page into a fast, confident, wrong one. The same file's session query has the same shape, though a member is unlikely to attend a thousand sessions. The page also asks for the totals twice, once when the page loads and again each time the metrics tab opens. The overview shows only two session fields, so the first request pulls every set row for nothing.
What would fix it
The comment already names the fix: a view or a database function that sums on the server and returns one row. That removes the cap, the transfer and the browser arithmetic at once, and it is a small migration with an obvious rollback. Short of that, asking for an exact count alongside the rows would at least let the page notice when it has been handed less than everything. Neither is in the code today. The row above now says where the ceiling is.
Why it belongs on this page
Naming a ceiling is still better than hiding one, and this note does not take that back. But a named ceiling is a claim, and it needs the same check as any other: read the line it sits on and ask what actually stops first. Here the answer was not the database or the browser. It was a default in a settings page, one layer away from the code, that the comment never mentions because nobody had to think about it at tens of rows.