Fix benchmark page query timeouts - #29
Merged
Merged
Conversation
The random-access summary and chart queries reached `open_mode` through `to_jsonb(r) ->> 'open_mode'`, and the compression-size summaries reached `uncompressed_bytes` through `to_jsonb(s) ->> 'uncompressed_bytes'`. That form was a bridge for databases that had not yet applied migrations 009 and 010, but `to_jsonb(r)` serializes the whole row. Every random-access row carries an `all_runtimes_ns` array with tens of thousands of samples (the benchmark records one entry per take for a 10 s time limit), so the summary serialized the entire table's sample arrays on every cache fill. On the production db.t4g.micro that statement now exceeds the 30 s `statement_timeout`, the group cache fill fails, and every landing-page render and `/api/groups` call dies with a server-side exception. Both migrations are applied in production, so read the columns directly. Locally, with 1000-sample arrays on a production-sized table, the random-access summary drops from 11.4 s to 0.2 s and the compression-size summary from 0.6 s to 0.3 s. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CFtMV8EAAHQM27PFzJjC4R
|
Vercel preview for |
robert3005
approved these changes
Sep 8, 2026
This branch was successfully deployed
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.
Reads
open_modeanduncompressed_bytesdirectly instead of converting whole rows to JSON. The previous queries serialized large runtime arrays and exceeded the 30-second PostgreSQL statement timeout, breaking the homepage and/api/groups. Migrations 009 and 010 are already applied in production. Validation: full CI checks, including PostgreSQL integration tests, plus a local production build and focused summary tests.