Re: Parallel Append implementation
Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
From: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Khandekar <amitdkhan.pg@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-03-09T12:42:39Z
Lists: pgsql-hackers
> > + if (rel->partial_pathlist != NIL && > + (Path *) linitial(rel->partial_pathlist) == subpath) > + partial_subplans_set = bms_add_member(partial_subplans_set, i); > > This seems like a scary way to figure this out. What if we wanted to > build a parallel append subpath with some path other than the > cheapest, for some reason? I think you ought to record the decision > that set_append_rel_pathlist makes about whether to use a partial path > or a parallel-safe path, and then just copy it over here. > I agree that assuming that a subpath is non-partial path if it's not cheapest of the partial paths is risky. In fact, we can not assume that even when it's not one of the partial_paths since it could have been kicked out or was never added to the partial path list like reparameterized path. But if we have to save the information about which of the subpaths are partial paths and which are not in AppendPath, it would take some memory, noticeable for thousands of partitions, which will leak if the path doesn't make into the rel->pathlist. The purpose of that information is to make sure that we allocate only one worker to that plan. I suggested that we use path->parallel_workers for the same, but it seems that's not guaranteed to be reliable. The reasons were discussed upthread. Is there any way to infer whether we can allocate more than one workers to a plan by looking at the corresponding path? -- Best Wishes, Ashutosh Bapat EnterpriseDB Corporation The Postgres Database Company
Commits
-
Update parallel.sgml for Parallel Append
- ac535cd47806 11.0 landed
- e80f2b335ecd 12.0 landed
-
Support Parallel Append plan nodes.
- ab7271677812 11.0 landed
-
Remove BufFile's isTemp flag.
- 11e264517dff 11.0 cited
-
Improve comments for parallel executor estimation functions.
- 11c1d555cebe 11.0 landed
-
Separate reinitialization of shared parallel-scan state from ExecReScan.
- 41b0dd987d44 11.0 cited
-
Eat XIDs more efficiently in recovery TAP test.
- 08aed6604de2 10.0 cited
-
Avoid syntax error on platforms that have neither LOCALE_T nor ICU.
- 457a44487328 10.0 cited
-
Preparatory refactoring for parallel merge join support.
- a71f10189dc1 10.0 cited