gp_toolkit.gp_skew_* should support replicated table correctly
gp_toolkit.gp_skew_* series views/functions are used to query how data is skewed in database. The idea is using a query like: "select gp_segment_id, count(*) cnt from foo group by gp_segment_id", and compare the cnt by gp_segment_id. For the replicated table, only one replica is picked to count the tuple number by the planner, so the old calculate logic produced a confusing result that a replicated table is skewed which is not expected: gpadmin=# select * From gp_toolkit.gp_skew_idle_fractions; sifoid | sifnamespace | sifrelname | siffraction --------+--------------+------------+------------------------ 16385 | public | rpt | 0.66666666666666666667 What's more, gp_segment_id is ambiguous for replicated table, so in commit b120194a, we disallow user to access system columns include gp_segment_id, so gp_toolkit.gp_skew_* views now report an error now. This commit correct the results of gp_toolkit.gp_skew_* views/functions for the replicated table although the results are pointless, however, this way should be more friendly for users.
Showing
想要评论请 注册 或 登录