mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +03:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user