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

From Manfred Koizar
Subject Re: EXISTS vs IN vs OUTER JOINS
Date
Msg-id 53m50vohh8v0asvmb425e9lplphvb1m6b1@4ax.com
Whole thread Raw
In response to Re: EXISTS vs IN vs OUTER JOINS  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-performance
On Thu, 19 Dec 2002 15:19:21 -0800, "Josh Berkus" <josh@agliodbs.com>
wrote:
>SELECT t1.*
>FROM table1 t1
>  LEFT JOIN table2 t2 ON t1.xid = t2.xid
>WHERE t2.label IS NULL

Josh, also note that Tomasz did something like

SELECT t1.*
FROM table1 t1
  LEFT JOIN table2 t2 ON t1.xid = t2.xid
WHERE t2.xid IS NULL
         ^^^
This special trick guarantees that you get exactly the rows from t1
not having a matching row in t2, because a NULL xid in t2 would not
satisfy the condition t1.xid = t2.xid.

Servus
 Manfred

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: EXISTS vs IN vs OUTER JOINS
Next
From: Manfred Koizar
Date:
Subject: Re: 4G row table?