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

Store zero-value table stats when diff doesn't exist #647

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

seanlinsley
Copy link
Member

merge_partition_sizes.go from #635 relies on RelationInformations and RelationStatistics being the same size and having a direct index mapping between them, but the code only stores statistics when a diff is available. This PR fixes that by storing a struct with zero values if a diff isn't available. This had already been done for index stats in #635, but table stats were missed.

@seanlinsley seanlinsley requested a review from a team December 2, 2024 17:37
s.RelationStatistics = append(s.RelationStatistics, &statistic)

// Events
s.RelationEvents = addRelationEvents(relationIdx, s.RelationEvents, stats.AnalyzeCount, stats.LastAnalyze, snapshot.RelationEvent_MANUAL_ANALYZE)
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 function has an early return if the stats count is zero, so it should be fine to call it whether or not diffed stats exist.

@seanlinsley seanlinsley merged commit 1b330c2 into main Dec 2, 2024
9 checks passed
@seanlinsley seanlinsley deleted the merge-partition-sizes-fix branch December 2, 2024 18:44
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.

2 participants