remove the 'distribution' field from SubqueryScanPath
authorTomas Vondra <[email protected]>
Sun, 22 Jan 2017 18:06:42 +0000 (19:06 +0100)
committerTomas Vondra <[email protected]>
Sun, 22 Jan 2017 18:06:42 +0000 (19:06 +0100)
Considering there's a distribution field in every Path (which
the SubqueryScanPath includes), this seems unnecessary and quite
confusing, because sometimes we work with (Path*) directly, and
sometimes through the 'path' field. It took me quite a bit of
time to realize that when create_subqueryscan_path does

    pathnode->distribution = X

it's not the same as doing

    pathnode->path.distribution = X

Note: It's possible that we in fact need the separate field for
somehow transformed distribution?

src/backend/optimizer/util/pathnode.c
src/include/nodes/relation.h

index cbec3cd34f689d6904b1ba6cd651175187cbee8b..ae8faf3a2a13d542778e044438f405cdb4b8e46f 100644 (file)
@@ -3066,7 +3066,7 @@ create_subqueryscan_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
        SubqueryScanPath *pathnode = makeNode(SubqueryScanPath);
 
 #ifdef XCP
-       pathnode->distribution = distribution;
+       pathnode->path.distribution = distribution;
 #endif
        pathnode->path.pathtype = T_SubqueryScan;
        pathnode->path.parent = rel;
index 77554872a6bd4fc1b158ba7328484d74fb694e34..c0bd1a7bc8c9fd967318072384f30fe69e2a2e63 100644 (file)
@@ -1077,7 +1077,6 @@ typedef struct SubqueryScanPath
 {
        Path            path;
        Path       *subpath;            /* path representing subquery execution */
-       Distribution *distribution; /* result distribution */
 } SubqueryScanPath;
 
 /*