X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 699D732A0C5 for ; Fri, 8 Oct 2004 16:21:29 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55877-07 for ; Fri, 8 Oct 2004 15:20:33 +0000 (GMT) Received: from brown.ursa-minor.com (brown.ursa-minor.com [66.152.196.41]) by svr1.postgresql.org (Postfix) with ESMTP id 3FF5332A06D for ; Fri, 8 Oct 2004 16:19:38 +0100 (BST) Received: from localhost (brown.ursa-minor.com [127.0.0.1]) by brown.ursa-minor.com (Postfix) with ESMTP id 58D872DE961; Fri, 8 Oct 2004 11:19:26 -0400 (EDT) Received: from brown.ursa-minor.com ([127.0.0.1]) by localhost (brown.ursa-minor.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09395-03; Fri, 8 Oct 2004 11:19:22 -0400 (EDT) Received: from [66.152.196.55] (grizzly.ursa-minor.com [66.152.196.55]) by brown.ursa-minor.com (Postfix) with ESMTP id E939D2DE95F; Fri, 8 Oct 2004 11:19:21 -0400 (EDT) Message-ID: <4166AFF9.1000603@murrain.net> Date: Fri, 08 Oct 2004 11:19:21 -0400 From: Michelle Murrain Reply-To: mmurrain@dbdes.com User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Thomas F.O'Connell" Cc: CHRIS HOOVER , sad@bankir.ru, pgsql-sql@postgresql.org Subject: Re: help on a query References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at ursa-minor.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=NO_DNS_FOR_FROM X-Spam-Level: * X-Archive-Number: 200410/51 X-Sequence-Number: 19154 Thomas F.O'Connell wrote: > I think the OUTER JOIN version is probably more efficient, but EXPLAIN > would tell you. Well, this all makes me feel better. For everyone's edification: select registration_id FROM registrations where registration_id not in (select registration_id from receipts); Generates 0 rows The OUTER JOIN version is quite a bit more efficient (by an order of magnitude) than the option with WHERE NOT EXISTS subquery. Thanks all for the help. Saved my butt again!! -- .Michelle -------------------------- Michelle Murrain mmurrain at dbdes dot com 413-222-6350 ph 617-889-0929 ph 952-674-7253 fax <--- new Page: pageme@murrain.net AIM:pearlbear0 ICQ:129250575 Skype: pearlbear Jabber: pearlbear@transactim.net "I see all the different religious traditions as paths for the development of inner peace, which is the true foundation of world peace. These ancient traditions come to us as a gift from our common past. Will we continue to cherish it as a gift and hand it over to the future generations as a legacy of our shared desire for peace?" - His Holiness the Dalai Lama