mark RemoteSubplan paths with parallel_safe=false and parallel_aware=false
authorTomas Vondra <tomas@2ndquadrant.com>
Sat, 14 Jan 2017 23:22:32 +0000 (00:22 +0100)
committerTomas Vondra <tomas@2ndquadrant.com>
Sat, 14 Jan 2017 23:22:32 +0000 (00:22 +0100)
We don't want to run parallel queries on the coordinators, particularly
when those queries query data nodes.

src/backend/optimizer/util/pathnode.c

index 8a93138b3c65bd8f51c5b31c840309d1464ff8ba..3bab1ed9f2d30ce3ec4071b2a61a189ff3a69543 100644 (file)
@@ -1237,6 +1237,10 @@ create_remotesubplan_path(PlannerInfo *root, Path *subpath,
        pathnode->subpath = subpath;
        pathnode->path.distribution = (Distribution *) copyObject(distribution);
 
+       /* We don't want to run subplains in parallel workers */
+       pathnode->path.parallel_aware = false;
+       pathnode->path.parallel_safe = false;
+
        pathnode->path.pathtarget = subpath->pathtarget;
 
        cost_remote_subplan((Path *) pathnode, subpath->startup_cost,