Re: Questions about Exists-Not exists clause

From: Avi Schwartz <avi(at)CFFtechnologies(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Questions about Exists-Not exists clause
Date: 2003-07-24 20:55:13
Message-ID: 1EF1E023-BE19-11D7-857F-000393AE5044@CFFtechnologies.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Not wrong, but under 7.3.x it can be much slower then using 'not
exists' when the sub-select returns a long list of values. I believe
the 7.4 fixes this so both will end up equivalent.

Avi

On Thursday, Jul 24, 2003, at 15:46 America/Chicago, M Spreij wrote:

>> SELECT * FROM A WHERE NOT EXISTS (SELECT NULL FROM B WHERE
>> A.field3=B.field6);
>
> I did this recently, using
> SELECT * FROM A WHERE field3 NOT IN (SELECT field6 FROM B)
>
> Now if this is totally wrong tell me *gently*, it's the first question
> I felt I was up to to answer :-)

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Alejandro Fuentes González 2003-07-24 22:47:38 PROBLEMS WITH GENERIC CONNECTIVITY
Previous Message M Spreij 2003-07-24 20:47:14 Re: design/copying a bunch of records