Brian Hirt <bhirt@mobygames.com> writes:
> Can't the rewrite engine recognize a simple case like the
> one above and rewrite it to use exists and not exists with the proper
> joins? Or possibly the optimizer can generate a better plan?
This is on the TODO list, and will get done someday. IMHO it's not as
urgent as a lot of the planner/optimizer's other shortcomings, because
it can usually be worked around by revising the query.
If it's bugging you enough to go fix it now, contributions are always
welcome ;-)
regards, tom lane