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 5DA469DCA08 for ; Tue, 14 Feb 2006 17:25:05 -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 70731-01 for ; Tue, 14 Feb 2006 17:25:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.192.83]) by postgresql.org (Postfix) with ESMTP id 0AB069DC9AC for ; Tue, 14 Feb 2006 17:25:02 -0400 (AST) Received: from [10.0.1.5] (c-24-20-199-254.hsd1.or.comcast.net[24.20.199.254]) by comcast.net (rwcrmhc13) with SMTP id <20060214212458m1300fifb5e>; Tue, 14 Feb 2006 21:25:04 +0000 Subject: Re: Non Matching Records in Two Tables From: Ken Hill Reply-To: ken@scottshill.com To: Tom Lane Cc: Markus Schaber , pgsql-sql@postgresql.org In-Reply-To: <22658.1139951249@sss.pgh.pa.us> References: <1139433024.2044.48.camel@localhost.localdomain> <43EA6333.7050604@logix-tt.com> <1139950507.3083.64.camel@localhost.localdomain> <22658.1139951249@sss.pgh.pa.us> Content-Type: multipart/alternative; boundary="=-zbwszlVC6qIttb9BFoGE" Organization: Scotts Hill Associates, Inc. Date: Tue, 14 Feb 2006 13:25:36 -0800 Message-Id: <1139952337.3083.68.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.081 required=5 tests=[AWL=0.080, HTML_MESSAGE=0.001] X-Spam-Score: 0.081 X-Spam-Level: X-Archive-Number: 200602/156 X-Sequence-Number: 24166 --=-zbwszlVC6qIttb9BFoGE Content-Type: text/plain Content-Transfer-Encoding: 7bit On Tue, 2006-02-14 at 16:07 -0500, Tom Lane wrote: > Ken Hill writes: > > Seq Scan on ncccr10 (cost=0.00..20417160510.08 rows=305782 width=104) > > Filter: (NOT (subplan)) > > SubPlan > > -> Seq Scan on ncccr9 (cost=0.00..65533.71 rows=494471 width=104) > > (4 rows) > > > Any ideas why it is so slow? > > "NOT (subplan)" is horrendous (and the system knows it, note the huge > cost estimate). Try increasing work_mem enough so you get a hashed > subplan instead. > > regards, tom lane How do I ncrease work_mem? --=-zbwszlVC6qIttb9BFoGE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit On Tue, 2006-02-14 at 16:07 -0500, Tom Lane wrote:
Ken Hill <ken@scottshill.com> writes:
>  Seq Scan on ncccr10  (cost=0.00..20417160510.08 rows=305782 width=104)
>    Filter: (NOT (subplan))
>    SubPlan
>      ->  Seq Scan on ncccr9  (cost=0.00..65533.71 rows=494471 width=104)
> (4 rows)

> Any ideas why it is so slow?

"NOT (subplan)" is horrendous (and the system knows it, note the huge
cost estimate).  Try increasing work_mem enough so you get a hashed
subplan instead.

			regards, tom lane

How do I ncrease work_mem? --=-zbwszlVC6qIttb9BFoGE--