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 9F0A59DC81F for ; Tue, 14 Feb 2006 17:07: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 64045-08 for ; Tue, 14 Feb 2006 17:07:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 543039DC804 for ; Tue, 14 Feb 2006 17:07:29 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k1EL7TJ4022659; Tue, 14 Feb 2006 16:07:29 -0500 (EST) To: ken@scottshill.com cc: Markus Schaber , pgsql-sql@postgresql.org Subject: Re: Non Matching Records in Two Tables In-reply-to: <1139950507.3083.64.camel@localhost.localdomain> References: <1139433024.2044.48.camel@localhost.localdomain> <43EA6333.7050604@logix-tt.com> <1139950507.3083.64.camel@localhost.localdomain> Comments: In-reply-to Ken Hill message dated "Tue, 14 Feb 2006 12:55:07 -0800" Date: Tue, 14 Feb 2006 16:07:29 -0500 Message-ID: <22658.1139951249@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.109 required=5 tests=[AWL=0.109] X-Spam-Score: 0.109 X-Spam-Level: X-Archive-Number: 200602/152 X-Sequence-Number: 24162 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