diff options
-rw-r--r-- | src/backend/optimizer/prep/prepunion.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index 2522636392..a8163bfaff 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -313,6 +313,19 @@ recurse_set_operations(Node *setOp, PlannerInfo *root, subpath = get_cheapest_fractional_path(final_rel, root->tuple_fraction); +#ifdef XCP + /* + * create remote_subplan_path if needed, and we'll use this path to + * create remote_subplan at the top. + */ + if(subpath->distribution) + { + subpath = create_remotesubplan_path(NULL, subpath, NULL); + + subroot->distribution = NULL; + } +#endif + /* * Stick a SubqueryScanPath atop that. * |