Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track parent partition size when child partitions are untracked #656

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

seanlinsley
Copy link
Member

#635 improved the fidelity of statistics tracked for parent partitions, but in moving the code from SQL to Go it stopped reporting the size of parent partitions when ignore_schema_regexp is set to ignore the child partitions. This PR fixes #654 by bringing back the original SQL, but only applying it to child partitions that match ignore_schema_regexp.

-- Only include sizes from child partitions skipped by ignore_schema_regexp.
-- Child partitions tracked by the collector have their sizes added by mergePartitionSizes.
AND ($1 != '' AND (n.nspname || '.' || t.relname) ~* $1)
), 0) AS size_bytes,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The screenshot below is from local testing. 11:40 shows the detailed stats from #635. I then updated the collector config with ignore_schema_regexp = 35d_, and then 12:10 shows the updated behavior with this PR. Ignore the in-between timestamps where I was fixing bugs.

Screenshot 2024-12-19 at 12 12 08 PM

//
// When ignore_schema_regexp is set, GetRelationStats bypasses this for tables not tracked by the collector.
//
// TODO: recursively build up stats when nested partitioning is used
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO is an existing issue with the code.

@seanlinsley seanlinsley requested a review from a team December 19, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.63.0 broke size reporting for TimescaleDB hypertables
2 participants