Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Jun 18, 2015 at 3:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I'm a bit surprised that duplicating the append_rel_list is a noticeable
>> performance problem. It ought to be far smaller than the Query tree that
>> we've always duplicated in this loop --- in particular, it's really a
>> subset of what we have in the RTE list, no?
> Well, append_rel_list has an AppendRelInfo for every RTE and that
> contains a List (translated_vars) which in turn contains a Var node
> for every column. I'm not sure how that compares to the RTE itself.
RTEs also have a per-column component, namely the lists of column alias
names. So there's something odd going on here. I'll dig into it when
I get a chance (possibly not during PGCon).
regards, tom lane