Fix plan when segmentgeneral union all general locus.
Previously, planner cannot generate plan when a replicated table union all a general locus scan. A typical case is: select a from t_replicate_table union all select * from generate_series(1, 10); The root cause is in the function `set_append_path_locus` it deduces the whole append path's locus to be segmentgeneral. This is reasonable. However, in the function `cdbpath_create_motion_path` it fails to handle two issues in the case: * segmentgeneral locus to segmentgeneral locus * general locus to segmentgeneral locus And the both above locus change does not need motion in fact. This commit fixes this by: 1. add a check at the very begining of `cdbpath_create_motion_path` that if the subpath's locus is the same as target locus, just return 2. add logic to handle general locus to segmentgeneral locus, just return
Showing
想要评论请 注册 或 登录