From: Nate Teller <nate.teller@mindspring.com>
To: Aaron Bono <postgresql@aranya.com>
To: Exner, Peter <Exner@his.de>
Cc: Richard Broersma Jr <rabroersma@yahoo.com>
Cc: SQL Postgresql List <pgsql-sql@postgresql.org>
Subject: Re: How to find entries missing in 2nd table?
Date: Sun, 16 Jul 2006 21:09:48 -0400
Message-ID: <JOEPKPKCCCBGEIEIKIIPCEHCDAAA.nate.teller@mindspring.com> (raw)
In-Reply-To: <bf05e51c0607130846ufdb8a31n5757f67361447c2b@mail.gmail.com>
I have received good performance with the following:
select c.controller
from control c
left outer join datapack d on d.controller_id = c.controller_id
where d.controller_id is null
Nate Teller
-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Aaron Bono
Sent: Thursday, July 13, 2006 11:46 AM
To: Exner, Peter
Cc: Richard Broersma Jr; SQL Postgresql List
Subject: Re: [SQL] How to find entries missing in 2nd table?
On 7/12/06, Exner, Peter < Exner@his.de <mailto:Exner@his.de> > wrote:
Hi,
what about
SELECT controller_id FROM control
WHERE controller_id NOT IN
(SELECT DISTINCT controller_id FROM datapack);
The DISTINCT is not necessary. I have heard with Oracle that DISTINCT is a
huge performance problem. Is that true on PostgreSQL also?
==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
==================================================================
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-sql@postgresql.org
Cc: nate.teller@mindspring.com, postgresql@aranya.com, Exner@his.de, rabroersma@yahoo.com
Subject: Re: How to find entries missing in 2nd table?
In-Reply-To: <JOEPKPKCCCBGEIEIKIIPCEHCDAAA.nate.teller@mindspring.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