X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BE15D9DC816 for ; Tue, 14 Feb 2006 17:08:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63074-07 for ; Tue, 14 Feb 2006 17:08:33 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web54302.mail.yahoo.com (web54302.mail.yahoo.com [206.190.49.112]) by postgresql.org (Postfix) with SMTP id 3F2979DC804 for ; Tue, 14 Feb 2006 17:08:28 -0400 (AST) Received: (qmail 79697 invoked by uid 60001); 14 Feb 2006 21:08:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=y6gylixj6llCoO33hPrH+orNyqUN1FUW0tLDcwSnXHEKSr07na/7AkEwGB76hR1UbNNqJ5O0gBhyyreeOEnDbzy0N9fAjIN9tuf/+crpiEQFzOhL+HfdbQZUXi8xCleLCoEaoJWH84EMHCabqpVJ0oHx3biRK45phaeTGF3ezfc= ; Message-ID: <20060214210829.79695.qmail@web54302.mail.yahoo.com> Received: from [68.54.4.83] by web54302.mail.yahoo.com via HTTP; Tue, 14 Feb 2006 13:08:29 PST Date: Tue, 14 Feb 2006 13:08:29 -0800 (PST) From: chester c young Subject: Re: Non Matching Records in Two Tables To: ken@scottshill.com, pgsql-sql@postgresql.org In-Reply-To: <1139950507.3083.64.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.479 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.479 X-Spam-Level: X-Archive-Number: 200602/153 X-Sequence-Number: 24163 > Here is my query SQL: > > SELECT key100 FROM ncccr10 > WHERE ncccr10.key100 NOT IN (SELECT key100 FROM ncccr9); > > It is is running after 30 minutes. Here is the query plan: > I would try an outer join: select a.key100 from ncccr10 a left join ncccr9 b on( key100 ) where b.key100 is null; also (hate to be obvious) have you analyzed lately? __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com