aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2018-04-17 16:19:48 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2018-04-17 16:25:02 -0300
commitb7e2cbc5b49fbab5bc286b9e4cd4062a6703e7a7 (patch)
tree31d04056d9c2e5da73aaa567318a3c0b9370c99b /src/include
parent55101549d538c9ed86e761dba0775025726d7310 (diff)
downloadpostgresql-b7e2cbc5b49fbab5bc286b9e4cd4062a6703e7a7.tar.gz
postgresql-b7e2cbc5b49fbab5bc286b9e4cd4062a6703e7a7.zip
Update Append's idea of first_partial_plan
It turns out that after runtime partition pruning, Append's first_partial_plan does not accurately represent partial plans to run, if any of those got pruned. This could limit participation of workers in some partial subplans, if other subplans got pruned. Fix it by keeping an index of the first valid partial subplan in the state node, determined at execnode Init time. Author: David Rowley, with cosmetic changes by me. Discussion: https://postgr.es/m/CAKJS1f8o2Yd=rOP=Et3A0FWgF+gSAOkFSU6eNhnGzTPV7nN8sQ@mail.gmail.com
Diffstat (limited to 'src/include')
-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 9fe0b790956..fe93e78bee8 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -1087,6 +1087,8 @@ struct AppendState
PlanState **appendplans; /* array of PlanStates for my inputs */
int as_nplans;
int as_whichplan;
+ int as_first_partial_plan; /* Index of 'appendplans' containing
+ * the first partial plan */
ParallelAppendState *as_pstate; /* parallel coordination info */
Size pstate_len; /* size of parallel coordination info */
struct PartitionPruneState *as_prune_state;