summaryrefslogtreecommitdiff
path: root/src/include/nodes/execnodes.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-10-27 16:04:01 +0200
committerRobert Haas <rhaas@postgresql.org>2017-10-27 16:04:10 +0200
commit965a16fa9f8c316c30f4ada3c1c98b5dd4666f25 (patch)
treee38839a9e424572faf810e0f9bb3b7d2c84320f4 /src/include/nodes/execnodes.h
parent6a81ba1d4d26b46636d652a3a56143c159da899c (diff)
Fix mistaken failure to allow parallelism in corner case.
If we try to run a parallel plan in serial mode because, for example, it's going to be scanned via a cursor, but for some reason we're already in parallel mode (for example because an outer query is running in parallel), we'd incorrectly try to launch workers. Fix by adding a flag to the EState, so that we can be certain that ExecutePlan() and ExecGather()/ExecGatherMerge() will have the same idea about whether we are executing serially or in parallel. Report and fix by Amit Kapila with help from Kuntal Ghosh. A few tweaks by me. Discussion: http://postgr.es/m/CAA4eK1+_BuZrmVCeua5Eqnm4Co9DAXdM5HPAOE2J19ePbR912Q@mail.gmail.com
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r--src/include/nodes/execnodes.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 9c790baaaa5..4f5da00c863 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -507,6 +507,8 @@ typedef struct EState
bool *es_epqTupleSet; /* true if EPQ tuple is provided */
bool *es_epqScanDone; /* true if EPQ tuple has been fetched */
+ bool es_use_parallel_mode; /* can we use parallel workers? */
+
/* The per-query shared memory area to use for parallel execution. */
struct dsa_area *es_query_dsa;
} EState;