From: | "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> |
---|---|
To: | "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>, "Oliveiros d'Azevedo Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt>, "Jonathan Hoover" <jhoover(at)yahoo-inc(dot)com> |
Cc: | <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: Get Postgres to use multiple proc cores? |
Date: | 2010-11-05 16:08:40 |
Message-ID: | 4CD3E5B8020000250003735A@gw.wicourts.gov |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
"Oliveiros d'Azevedo Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt>
wrote:
> What is faster? A JOIN or a WHERE a IN (SELECT ... )
On 8.4 and later an EXISTS or NOT EXISTS will use semi-join or
anti-join (respectively). These should usually be much faster than
the IN (SELECT DISTINCT ... ) technique. Be careful of the
difference in semantics between NOT EXISTS and NOT IN if any of the
columns involved in the matching can be null -- they are *not* the
same thing.
-Kevin
From | Date | Subject | |
---|---|---|---|
Next Message | Jonathan Hoover | 2010-11-06 15:01:18 | Interesting Query Performance Question |
Previous Message | Scott Marlowe | 2010-11-05 15:33:47 | Re: Get Postgres to use multiple proc cores? |