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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]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 <[EMAIL PROTECTED]> 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 via email to