Re: Index Usage using IN - Mailing list pgsql-performance

From Jeffrey W. Baker
Subject Re: Index Usage using IN
Date
Msg-id 1138825370.8376.5.camel@toonses.gghcwest.com
Whole thread Raw
In response to Index Usage using IN  (Ralph Mason <ralph.mason@telogis.com>)
Responses Re: Index Usage using IN  ("Jeffrey W. Baker" <jwbaker@acm.org>)
Re: Index Usage using IN  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
On Thu, 2006-02-02 at 09:12 +1300, Ralph Mason wrote:
> Hi,
>
> I have 2 tables both have an index on ID (both ID columns are an oid).
>
> I want to find only only rows in one and not the other.
>
> Select ID from TableA where ID not IN ( Select ID from Table B)

Have you considered this:

SELECT ID from TableA EXCEPT Select ID from Table B

?

-jwb


pgsql-performance by date:

Previous
From: Ralph Mason
Date:
Subject: Index Usage using IN
Next
From: "Kevin Grittner"
Date:
Subject: Re: Planner reluctant to start from subquery