Repository navigation
v2.9274 — Bids and the Dashboard open with far fewer requests - #10767
Merged
Merged
Conversation
The pending-audits gate asked the server once for each bid with a pending robot audit: 74 HEAD counts at once on every open of Bids and of Needs you, 8.1% of all database time. One read of the pending bids, each with at most one of its count rows, now answers for all of them. Client only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What was wrong
A teammate reported the live app as nearly too slow to use, worst on the Bid Board. Read on prod on 2026-12-03, reads only.
useBidAuditsPendingCountasked the server once for each bid with a pending robot audit, all at once, on every open of the Bids page and of every screen that reads Needs you.HEADcounts onbids_count_rows.pg_stat_statementsthat statement had 170,191 calls at 80 ms mean over nine and a half days: 8.1% of all database time, the largest of any statement the app sends.What changed
PENDING_PRICED_SELECT, the limit set on the embedded table, chunks of 100).bidsreachesbids_count_rowstwo ways and PostgREST refuses an unnamed embed (PGRST201). Tried against prod's API as a signed-out caller: the named shape is accepted, the unnamed one is refused.bids_count_rows), so a bid the person cannot read counted 0 before and reads as unpriced now. A failed read leaves every pending audit counted, as before.Client only. No migration, no function change, nothing owed on prod.
Not shown
That this burst is what the teammate felt. It is the largest load the Bids page put on the database and it lands as the board opens. Not in this change: the
jobs_ledgerrow policies (every read of that table costs 0.2 to 0.6 s), which is a migration of its own.Checks
src/lib/bids/bidAudits.test.ts(24 tests) andsrc/lib/releaseNotes.test.tspass.check:layers,check:error-wordspass.bids?select=id,bids_count_rows...request where 74 counts were.🤖 Generated with Claude Code