propagate distribution through UpperUniquePath and SetOpPath
authorTomas Vondra <[email protected]>
Sun, 22 Jan 2017 22:57:31 +0000 (23:57 +0100)
committerTomas Vondra <[email protected]>
Sun, 22 Jan 2017 22:57:31 +0000 (23:57 +0100)
Simply create a copy of the subpath's distribution, just like in most
other paths.

src/backend/optimizer/util/pathnode.c

index 3c7553051db8271ec3c9e383593252d154cc9a15..4077b8770b9fa7739f3927bde504c11adb90c906 100644 (file)
@@ -3884,6 +3884,8 @@ create_upper_unique_path(PlannerInfo *root,
        /* Unique doesn't change the input ordering */
        pathnode->path.pathkeys = subpath->pathkeys;
 
+       pathnode->path.distribution = (Distribution *) copyObject(subpath->distribution);
+
        pathnode->subpath = subpath;
        pathnode->numkeys = numCols;
 
@@ -4256,6 +4258,8 @@ create_setop_path(PlannerInfo *root,
        pathnode->path.pathkeys =
                (strategy == SETOP_SORTED) ? subpath->pathkeys : NIL;
 
+       pathnode->path.distribution = copyObject(subpath->distribution);
+
        pathnode->subpath = subpath;
        pathnode->cmd = cmd;
        pathnode->strategy = strategy;