Josh Berkus <josh@agliodbs.com> writes:
> On 03/06/2013 06:54 AM, David Leverton wrote:
>> I'm encountering very poor query plans when joining against a union,
> Actually, in case #4, Postgres *is* pushing down the join qual into the
> segments of the Union.
Yeah, but not further. I believe the core issue here (as of 9.2) is
that we're not willing to generate parameterized paths for subquery
relations. We could do that without a huge amount of new code,
I think, but the scary thing is how much time it might take to generate
(and then discard most of the) plans for assorted parameterizations of
complicated subqueries.
regards, tom lane