Re: EXCEPT performace - Mailing list pgsql-general

From Tom Lane
Subject Re: EXCEPT performace
Date
Msg-id 23047.1004983024@sss.pgh.pa.us
Whole thread Raw
In response to EXCEPT performace  ("K. Ari Krupnikov" <ari@cogsci.ed.ac.uk>)
List pgsql-general
"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

pgsql-general by date:

Previous
From: "Johnny J\xF8rgensen"
Date:
Subject: Re: Function problems redux
Next
From: Stephan Szabo
Date:
Subject: Re: Referring a table in another database