Re: Identity projection

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: "'Kyotaro HORIGUCHI'" <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <hlinnaka(at)iki(dot)fi>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Identity projection
Date: 2013-02-13 03:38:21
Message-ID: 001801ce099b$92b2df20$b8189d60$@kapila@huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, February 13, 2013 8:12 AM Kyotaro HORIGUCHI wrote:
> Hello. Sorry for long absence.
>
> # I've lost my health and am not fully recovered..
>
> The direction of the discussion now taken place is just what I've
> wanted. The patch I proposed simply came from my poor
> understanding about exact how to detect identity projection by
> comparing tlists, and I couldn't found how to eliminate unwanted
> nodes appropriately.

I have updated the patch as per comments from Tom and Heikki.
If you can verify it, then IMO it can be marked as 'Ready For Committer'


> Thanks, Amit. I'll catch up this discussion soon.


> amit.kapila> Amit kapila <amit(dot)kapila(at)huawei(dot)com> writes:
> amit.kapila> >>> if (!is_projection_capable_plan(result_plan) &&
> compare_tlist_exprs(sub_tlist, result_plan->targetlist) )
> amit.kapila>
> amit.kapila> >> Sorry, the check I suggested in last mail should be as
> below:
> amit.kapila>
> amit.kapila> >> if (!is_projection_capable_plan(result_plan) &&
> !compare_tlist_exprs(sub_tlist, result_plan->targetlist) )
> amit.kapila>
> amit.kapila> > You know, I was thinking that compare_tlist_exprs() was
> a pretty
> amit.kapila> > unhelpfully-chosen name for a function returning
> boolean, and this
> amit.kapila> > thinko pretty much proves the point. It'd be better to
> call it
> amit.kapila> > something like equivalent_tlists(),
> tlists_are_equivalent(), etc.
> amit.kapila> > (I'm not caring for the emphasis on the exprs either,
> because I think
> amit.kapila> > it'll also be necessary to compare resjunk fields for
> instance.)
> amit.kapila>
> amit.kapila> The fields which cannot be compared are resname,
> resorigtbl, resorigcol as these gets cleared in planner.
> amit.kapila> I am not sure about fields resno and ressortgroupref, but
> I will check in more detail before sending patch.
>
> With best regards,
>
> --
> Kyotaro Horiguchi

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2013-02-13 04:00:45 Re: JSON Function Bike Shedding
Previous Message Craig Ringer 2013-02-13 03:12:09 Re: [HACKERS] JPA + enum == Exception