Re: EXISTS vs IN vs OUTER JOINS - Mailing list pgsql-performance

From jasiek@klaster.net
Subject Re: EXISTS vs IN vs OUTER JOINS
Date
Msg-id 20021219172733.GA1001@serwer
Whole thread Raw
In response to Re: EXISTS vs IN vs OUTER JOINS  ("Josh Berkus" <josh@agliodbs.com>)
Responses Re: EXISTS vs IN vs OUTER JOINS  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
On Thu, Dec 19, 2002 at 09:15:36AM -0800, Josh Berkus wrote:
> > -select * from some_table t
> >    left join filter f using (id)
> >   where f.id is [not] null;
>
> This will not get you the same result as the above.  It will get you
> all rows from t+f where a record is present in f and has (or does not
> have) a NULL value for f.id.   While this type of query works in MS
> Access, it will not work in SQL92/99-commpliant databases.

filter_table does not contain null fields. It has only two states: it
has row
or it hasn't row coresponding to row in some_table.

And now, which one is better?

Tomasz Myrta

pgsql-performance by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: EXISTS vs IN vs OUTER JOINS
Next
From: Joe Conway
Date:
Subject: Re: EXISTS vs IN vs OUTER JOINS