Re: Identity projection

Amit Kapila <amit.kapila@huawei.com>

From: Amit kapila <amit.kapila@huawei.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "hlinnaka@iki.fi" <hlinnaka@iki.fi>, "'Kyotaro HORIGUCHI'" <horiguchi.kyotaro@lab.ntt.co.jp>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2013-02-09T02:49:41Z
Lists: pgsql-hackers
Saturday, February 09, 2013 6:56 AM Amit kapila wrote:
>Friday, February 08, 2013 11:06 PM Tom Lane wrote:
> >Amit Kapila <amit(dot)kapila(at)huawei(dot)com> writes:
>>> On Friday, February 08, 2013 12:00 AM Tom Lane wrote:
>>> As per my understanding, currently in code wherever Result node can be
>>> avoided,

>> Hm.  Really there's a whole dance that typically goes on, which is like

>>                if (!is_projection_capable_plan(result_plan))
>>                ....

>> Perhaps we could encapsulate this whole sequence into a function called
>> say assign_targetlist_to_plan(), which would have the responsibility to
>> decide whether a Result node needs to be inserted.

> if (!is_projection_capable_plan(result_plan) && compare_tlist_exprs(sub_tlist, result_plan->targetlist) )

Sorry, the check I suggested in last mail should be as below:

if (!is_projection_capable_plan(result_plan) && !compare_tlist_exprs(sub_tlist, result_plan->targetlist) )


With Regards,
Amit Kapila.