Clean up the internal functions to merge partition stats a bit.
aggregate_leaf_partition_MCVs() and aggregate_leaf_partition_histograms() functions did catalog lookups to count how many leaf partitions a root table has. Why? Because the caller passes two arrays as inputs, with an entry for each partition, and the functions need to know how large the input arrays are. That's overly complicated, of course: the caller can simply pass the size of the arrays as an argument. That's much more robust too, I think the current code would crash and burn if the partition hierarchy was modified concurrently. I'm not sure if that's a live bug, or if we're holding locks that prevent that, but let's keep things simple in any case. This removes the last callers of rel_get_leaf_children_relids() function, so remove that altogether. Reviewed-by: NAbhijit Subramanya <asubramanya@pivotal.io> Reviewed-by: NHans Zeller <hzeller@vmware.com>
Showing
想要评论请 注册 或 登录