"K. Ari Krupnikov" <ari@cogsci.ed.ac.uk> writes:
> I noticed an unexpected difference in performance between seemingly equivalent queries:
> SELECT id FROM short_table EXCEPT SELECT id FROM long_table;
> and
> SELECT id FROM short_table EXCEPT
> (SELECT id FROM short_table JOIN long_table
> ON short_table.id = long_table.id);
But they're not equivalent. Consider what happens when NULLs are
present in both tables.
regards, tom lane