On Fri, Jun 17, 2016 at 8:18 AM, Amit Kapila <
amit.kapila@enterprisedb.com> wrote:
>
> On Fri, Jun 17, 2016 at 3:20 AM, Robert Haas <
robertmhaas@gmail.com> wrote:
> >
>
> > 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.