Re: why not parallel seq scan for slow functions
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-09-06T17:47:16Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > On Tue, Sep 5, 2017 at 4:34 AM, Amit Kapila <amit.kapila16@gmail.com> wrote: >> Okay, now I understand your point, but I think we already change the >> cost of paths in apply_projection_to_path which is done after add_path >> for top level scan/join paths. > Yeah. I think that's a nasty hack, and I think it's Tom's fault. :-) Yeah, and it's also documented: * This has the same net effect as create_projection_path(), except that if * a separate Result plan node isn't needed, we just replace the given path's * pathtarget with the desired one. This must be used only when the caller * knows that the given path isn't referenced elsewhere and so can be modified * in-place. If somebody's applying apply_projection_to_path to a path that's already been add_path'd, that's a violation of the documented restriction. It might be that we should just get rid of apply_projection_to_path and use create_projection_path, which is less mistake-prone at the cost of manufacturing another level of Path node. Now that that has the dummypp flag, it really shouldn't make any difference in terms of the accuracy of the cost estimates. > I'd feel a lot happier if Tom were to decide how this ought to be > fixed, because - in spite of some modifications by various parallel > query code - this is basically all his design and mostly his code. I can take a look, but not right away. regards, tom lane
Commits
-
Rewrite the code that applies scan/join targets to paths.
- 11cf92f6e2e1 11.0 landed
-
Teach create_projection_plan to omit projection where possible.
- d7c19e62a8e0 11.0 landed
-
Make the upper part of the planner work by generating and comparing Paths.
- 3fc6e2d7f5b6 9.6.0 cited