I've gotten a bee in my bonnet again about Resdom being wasteful.
There is no case where Resdom appears without TargetEntry, nor vice
versa, so we ought to fold them into a single node type. Is anyone
out there working on a patch that would be seriously affected by
such a change? If so speak up --- this could certainly wait till
after you merge.
IIRC the reason for the separation is that long ago in Berkeley days,
a TargetEntry could contain either a Resdom or an Fjoin ... but we got
rid of Fjoin in 7.4 (it was broken long before that) and it's not likely
to come back.
The advantage of folding 'em together is code simplification and
elimination of palloc overhead. I doubt it'll really make for a
measurable speedup, but I think it's worth doing anyway to simplify
the code.
Objections?
regards, tom lane