From: Jeffrey W. Baker <jwbaker@acm.org>
To: pgsql-performance@postgresql.org
Subject: Re: Index Usage using IN
Date: Wed, 01 Feb 2006 12:22:50 -0800
Message-ID: <1138825370.8376.5.camel@toonses.gghcwest.com> (raw)
In-Reply-To: <43E1164B.7020104@telogis.com>
References: <43E1164B.7020104@telogis.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: jwbaker@acm.org
Subject: Re: Index Usage using IN
In-Reply-To: <1138825370.8376.5.camel@toonses.gghcwest.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox