Repository navigation
fix(github): report table growth per table, capped - #209
Merged
Merged
Conversation
computedStats lists every relation, and an index reports the row count of the table it sits on. So one table that grew was named once per index: the first live run listed 14 bigger 'tables' for 4 that actually grew, including oauth_tokens_pkey and sessions_expire_idx. Filter to the table names the run's statisticsMode carries, and name the three biggest with a count for the rest. 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: "019fb977-3751-7d49-bcc7-9d51455e51bb" }) · 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
Make the growth line readable and true. Follow-up to #206, caught on its first live run.
What
Before, on Site#3775:
14 entries for 4 tables.
oauth_tokens_pkeyis an index, and it reports the row count of the table it sits on, so every index on a grown table repeated that table's growth.After:
How
computedStats.reltupleshas norelkind, so a relation cannot be classified from that payload alone. The run'sstatisticsMode.statscarriestableNamefor real tables, somain.tsbuilds a set from it andtableGrowthfilters against it. Without the set the function keeps every relation, which is the behaviour a run planned on assumptions gets.The template names the three biggest and counts the rest.
Tests
table-growth.test.tscovers dropping an index that mirrors its table, and keeping every relation when no table list is known.github.test.tscovers the cap. Full suite: 404 passing, 41 files, typecheck clean.