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. Thanks, Amit. I'll catch up this discussion soon. amit.kapila> Amit kapila <amit.kap...@huawei.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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers