More reasonable update on modify_count and row_count for global stats #38955
Labels
affects-6.1
affects-6.3
affects-6.4
component/statistics
sig/planner
SIG: Planner
type/enhancement
The issue or PR belongs to an enhancement.
Enhancement
After
analyze table t partition p1
, modify_count and row_count of global stats are 0 and 7 respectively. However, the more reasonable modify_count and row_count is 2 and 9.When we merge partition stats to global stats after analyzing several partitions, we set modify_count to 0 and set row_count to the sum of each partition's analyze_row_count. However, the better way is to set modify_count to the sum of each partition's modify_count and set row_count to the sum of each partition's real_time_row_count.
PS: analyze_row_count is the count calculated by last analyze, dumping stats delta doesn't change it. real_time_row_count is the count based on analyze_row_count and updated by dumping stats delta.
The text was updated successfully, but these errors were encountered: