On Fri, Jun 17, 2016 at 8:18 AM, Amit Kapila <amit.kap...@enterprisedb.com>
> On Fri, Jun 17, 2016 at 3:20 AM, Robert Haas <robertmh...@gmail.com>
> >
> > Something like what you have there might work if you use
> > create_projection_path instead of apply_projection_to_path.
> >
> Okay, I think you mean to say use create_projection_path() while applying
scanjoin_target to partial path lists in below code:
> foreach(lc, current_rel->partial_pathlist)
> {
> Path   *subpath = (Path *) lfirst(lc);
> Assert(subpath->param_info == NULL);
> lfirst(lc) = apply_projection_to_path(root, current_rel,
> subpath, scanjoin_target,
> scanjoin_target_parallel_safe);
> }

Attached, please find updated patch based on above lines.  Due to addition
of projection path on top of partial paths, some small additional cost is
added for parallel paths. In one of the tests in select_parallel.sql the
plan was getting converted to serial plan from parallel plan due to this
cost, so I have changed it to make it more restrictive.  Before changing, I
have debugged the test to confirm that it was due to this new projection
path cost.  I have added two new tests as well to cover the new code added
by patch.

Note - Apart from the tests related to new code,  Dilip Kumar has helped to
verify that TPC-H queries also worked fine (he tested using Explain). He
doesn't encounter problem reported above [1] whereas without patch TPCH
queries were failing.

[1] - https://www.postgresql.org/message-id/575E6BE6.8040006%40lab.ntt.co.jp

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment: fix_scanjoin_pathtarget_v2.patch
Description: Binary data

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to