On Wed, Jun 5, 2019 at 9:24 AM Wu, Fei <wufei.f...@cn.fujitsu.com> wrote: > > Hi, all > > Lately I was researching Parallelism of Postgres 10.7(and it is same in all > version), and I was confused when reading the comment of function > ExecParallelEstimate : > > (in src/backend/executor/execParallel.c) > > ---------------------------------------------- > > > > * While we're at it, count the number of PlanState nodes in the tree, so > > * we know how many SharedPlanStateInstrumentation structures we need. > > static bool > > ExecParallelEstimate(PlanState *planstate, ExecParallelEstimateContext *e) > > ---------------------------------------------- > > > > The structure SharedPlanStateInstrumentation is not exists at all. And I > noticed that the so called “SharedPlanStateInstrumentation” > > maybe is the structure instrumentation now, which is used for storing > information of planstate in parallelism. The function count the number > > of planState nodes and stored it in ExecParallelEstimateContext-> nnodes > ,then use it to Estimate space for instrumentation structure in > > function ExecInitParallelPlan. >
I think here it refers to SharedExecutorInstrumentation. This structure is used for accumulating per-PlanState instrumentation. So, it is not totally wrong, but I guess we can change it to SharedExecutorInstrumentation to avoid confusion? What do you think? -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com