aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/outfuncs.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-03-31 21:01:20 -0400
committerRobert Haas <rhaas@postgresql.org>2017-03-31 21:10:30 -0400
commitfb1879c374581c0f0e251e94c0087c8385b91f5b (patch)
tree0b215b2ffd203f8e546fe250c37d2678fc094520 /src/backend/nodes/outfuncs.c
parent9b6e8d8f86acde571d967f85c8b8ae695a3ddba8 (diff)
downloadpostgresql-fb1879c374581c0f0e251e94c0087c8385b91f5b.tar.gz
postgresql-fb1879c374581c0f0e251e94c0087c8385b91f5b.zip
Fix parallel query so it doesn't spoil row estimates above Gather.
Commit 45be99f8cd5d606086e0a458c9c72910ba8a613d removed GatherPath's num_workers field, but this is entirely bogus. Normally, a path's parallel_workers flag is supposed to indicate the number of workers that it wants, and should be 0 for a non-partial path. In that commit, I mistakenly thought that GatherPath could also use that field to indicate the number of workers that it would try to start, but that's disastrous, because then it can propagate up to higher nodes in the plan tree, which will then get incorrect rowcounts because the parallel_workers flag is involved in computing those values. Repair by putting the separate field back. Report by Tomas Vondra. Patch by me, reviewed by Amit Kapila. Discussion: http://postgr.es/m/f91b4a44-f739-04bd-c4b6-f135bd643669@2ndquadrant.com
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r--src/backend/nodes/outfuncs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index 0ccd75b74a8..f8d43dbf993 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -1795,6 +1795,7 @@ _outGatherPath(StringInfo str, const GatherPath *node)
WRITE_NODE_FIELD(subpath);
WRITE_BOOL_FIELD(single_copy);
+ WRITE_INT_FIELD(num_workers);
}
static void