"Robert Haas" <robertmhaas(at)gmail(dot)com> writes:
> I can predict that Tom will say that the planning time it would take
> to avoid this problem isn't justified by the number of queries that it
> would improve.
Took the words right out of my mouth ;-)
It would be *possible* to do this sort of thing, but what it would
imply is re-planning entire join nests on the strength of assumptions
that some additional constraints are available. Right now we only
do that for individual inner-side relations. AFAICS extending that
to sub-joins would result in an exponential increase in plan time.
regards, tom lane