Re: EXISTS vs IN vs OUTER JOINS

From: jasiek(at)klaster(dot)net
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tomasz Myrta <jasiek(at)klaster(dot)net>, PgSQL Performance ML <pgsql-performance(at)postgresql(dot)org>
Subject: Re: EXISTS vs IN vs OUTER JOINS
Date: 2002-12-19 17:27:33
Message-ID: 20021219172733.GA1001@serwer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Joe Conway 2002-12-19 17:43:24 Re: EXISTS vs IN vs OUTER JOINS
Previous Message Josh Berkus 2002-12-19 17:15:36 Re: EXISTS vs IN vs OUTER JOINS