Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> However, there's an obvious improvement that can be made to Tom's
> patch -- having computed modifiableARIindexes, you may as well use it
> in the innermost loop to only apply ChangeVarNodes() to those
> AppendRelInfo's that can actually change, rather than having it trawl
> through all the other ones that we know won't be touched.
Right. Also, as Robert noted, we can short-circuit a few more things when
there are no subquery RTEs. I'll combine these ideas and push something,
but probably not till tomorrow.
regards, tom lane