Repository navigation
feat(github): say which table grew when queries got more expensive - #206
Merged
Merged
Conversation
A cost comparison sees two numbers and calls the difference a regression. On run 019fb8fd nine queries went up on a pull request that changed one markdown file: project_queries had grown 80% overnight, and every one of the nine reads that table. Both runs already carry the row counts the planner used. GET /ci/runs/latest returns computedStats and the PreviousRun type dropped it, so the comment could not see the growth it was blaming on the diff. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
6 successful checks
More details via MCP → get_ci_run({ runId: "019fb933-180f-7f37-9582-ec9f50d73459" }) · view run · docs
3 queries read against main on assumed statistics of 10,000,000 rows per table. Sync production stats for costs measured against your real data.
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.
Goal
Stop the comment blaming a diff for the database growing. Follow-up to #201 and #205.
What
Run
019fb8fdblocked Site#3775, a pull request that changes one markdown file, on 9 cost regressions. The cause was not the diff:All 9 read that table. The other 4 movers over threshold read
oauth_tokens, which grew 28%.After, the regression gate carries a line above its queries:
How
src/gate/table-growth.tsdiffs the two runs'computedStats.reltuplesand returns tables that grew at least 10%, largest first. It returns nothing when either side lacks statistics, which is the case for a run planned on assumptions.PreviousRungainscomputedStats.GET /ci/runs/latesthas always returned it — the type dropped it, which is why the comment could not see the growth.The line states the growth and stops. It does not claim the growth explains any particular query, because the comparison cannot prove that; a reader who sees
project_queries +80%above nine queries that readproject_queriescan draw it themselves.Tests
table-growth.test.tscovers the largest-first ordering, ignoring noise under 10%, and returning nothing without statistics.github.test.tscovers the line rendering under a fired gate and staying absent when no table grew. Full suite: 393 passing, 40 files, typecheck clean.Not in this PR
Per-query attribution.
RegressedQuerywould needtableReferences, whichcompareRunsdrops the same way it droppedtagsbefore #202. That would let the gate soften a regression whose tables grew, rather than only explaining it.