-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor merging of partitioned table statistics to occur earlier
Previously we merged this data after we completed gathering all output statistics. Besides this being challenging to make work correctly in light of locked tables (which mean indexes into the statistics array need to be looked up carefully via RelationIdx), it also had to resort to some workarounds to find the relationship of child indexes to their parent indexes. Instead, replace the logic with an approach that gathers all declarative partition child tables and indexes during the input phase, and then use that to look up the statistics to be added when we first construct the output statistics data. Note this replaces the previous index child/parent heuristic (which worked based on the columns being identical, and only considered unique indexes) with simply relying on child indexes being tracked in pg_inherits to belong to their parent. This means the parent index sizes will now exclude any indexes that were directly created on the children but shared a name with an empty parent index, which may be the case when inheritance-based partitioning was migrated to declarative partitioning. On the other hand, this will now consistently make most declaratively partitioned tables have their index sizes correctly added up to the parent, even if the indexes are not unique, or use expressions.
- Loading branch information
Showing
6 changed files
with
54 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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