X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2A6CD9FB274 for ; Thu, 13 Jul 2006 12:46:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 12073-05-3 for ; Thu, 13 Jul 2006 12:46:21 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by postgresql.org (Postfix) with ESMTP id 4CF919FB460 for ; Thu, 13 Jul 2006 12:46:13 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id m2so324677uge for ; Thu, 13 Jul 2006 08:46:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=mtVUDYGiTA5bNKNJlxLneNSqVlkCtDWEf10c56RfyrDFExpwNIm4BEPofIenczYPV9B5BzEgqY+ov6EXbGnHqdQ0+QGJgUkVzjCVGYXN2F+dPpSt6/OVZgF6UPcoqqtKNskffbJnhV/17HA/CzcBYtd9mHbGLib/1Cg3AXqKBjg= Received: by 10.78.160.2 with SMTP id i2mr775016hue; Thu, 13 Jul 2006 08:46:11 -0700 (PDT) Received: by 10.78.29.15 with HTTP; Thu, 13 Jul 2006 08:46:11 -0700 (PDT) Message-ID: Date: Thu, 13 Jul 2006 10:46:11 -0500 From: "Aaron Bono" To: "Exner, Peter" Subject: Re: How to find entries missing in 2nd table? Cc: "Richard Broersma Jr" , "SQL Postgresql List" In-Reply-To: <507847EF2B23D748BAC77799DA52D0EC6FD63F@mailbox.his.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11502_26436187.1152805571706" References: <507847EF2B23D748BAC77799DA52D0EC6FD63F@mailbox.his.de> X-Google-Sender-Auth: a179268a23afc819 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/202 X-Sequence-Number: 25776 ------=_Part_11502_26436187.1152805571706 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/12/06, Exner, Peter 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 ================================================================== ------=_Part_11502_26436187.1152805571706 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/12/06, Exner, Peter <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
================================================================== ------=_Part_11502_26436187.1152805571706--