Andrew Sullivan <andrew@libertyrms.info> writes:
> Just out of curiosity, is there a fundamental reason the optimiser
> doesn't just rewrite NOT IN queries to use the NOT EXISTS form,
There are cases where the NOT IN implementation is better; I'd not like
to see the system forcing one approach to be used.
In the long run we should try to fix IN/NOT IN/EXISTS/NOT EXISTS to be
treated as variant kinds of join, at least for the simple cases that
people tend to use a lot. This has been on the TODO list for awhile
but hasn't risen to the top.
regards, tom lane