* Create a per-plan-node workspace for collecting per-worker data. * * Output related to each worker will be temporarily "set aside" into a * separate buffer, which we'll merge into the main output stream once * we've processed all data for the plan node. This makes it feasible to * generate a coherent sub-group of fields for each worker, even though the * code that produces the fields is i
| 5220 | * ExplainOpenSetAsideGroup and ExplainSaveGroup/ExplainRestoreGroup. |
| 5221 | */ |
| 5222 | static ExplainWorkersState * |
| 5223 | ExplainCreateWorkersState(int num_workers) |
| 5224 | { |
| 5225 | ExplainWorkersState *wstate; |
| 5226 | |
| 5227 | wstate = (ExplainWorkersState *) palloc(sizeof(ExplainWorkersState)); |
| 5228 | wstate->num_workers = num_workers; |
| 5229 | wstate->worker_inited = (bool *) palloc0(num_workers * sizeof(bool)); |
| 5230 | wstate->worker_str = (StringInfoData *) |
| 5231 | palloc0(num_workers * sizeof(StringInfoData)); |
| 5232 | wstate->worker_state_save = (int *) palloc(num_workers * sizeof(int)); |
| 5233 | return wstate; |
| 5234 | } |
| 5235 | |
| 5236 | /* |
| 5237 | * Begin or resume output into the set-aside group for worker N. |
no test coverage detected