Kris Jurka <jurka@ejurka.com> writes:
> While adding schema support to the JDBC Driver, I came across a
> query which occasionally generates some spectacularly bad plans.
Interesting. The inconsistency you're seeing is a result of GEQO. I
would have hoped that it would have produced a better quality plan
more often, but apparently not. On my system, the regular query
optimizer handily beats GEQO for this query: it produces more
efficienty query plans 100% of the time and takes less time to do so.
For *this* query at least, raising geqo_threshold would be a good
idea, but that may not be true universally.
> I thought someone might be interested in a test case for the
> optimizer.
Thanks, it's a useful query -- I've been meaning to take a look at
GEQO for a while now...
Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC