Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 2EF879FB39A for ; Fri, 10 Nov 2006 03:25:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 57668-01-4 for ; Fri, 10 Nov 2006 07:25:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from fugue.toroid.org (fugue.toroid.org [85.10.196.113]) by postgresql.org (Postfix) with ESMTP id 253429FB36D for ; Fri, 10 Nov 2006 03:07:04 -0400 (AST) Received: from penne.toroid.org (localhost [127.0.0.1]) by fugue.toroid.org (Postfix) with ESMTP id 600C08B51; Fri, 10 Nov 2006 08:07:02 +0100 (CET) Received: by penne.toroid.org (Postfix, from userid 1000) id 19DB03E2700; Fri, 10 Nov 2006 12:37:00 +0530 (IST) Date: Fri, 10 Nov 2006 12:37:00 +0530 From: Abhijit Menon-Sen To: Tom Lane Cc: pgsql-performance@postgresql.org, arnt@oryx.com Subject: Re: 10x rowcount mis-estimation favouring merge over nestloop Message-ID: <20061110070700.GA2751@penne.toroid.org> References: <20061110051245.GA1928@penne.toroid.org> <16547.1163139324@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16547.1163139324@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/94 X-Sequence-Number: 21864 At 2006-11-10 01:15:24 -0500, tgl@sss.pgh.pa.us wrote: > > it seems that "field<=12" is true for a much smaller fraction of the > rows satisfying (part!='' or value ilike '%,%') than for the general > population of rows in the header_fields table. Indeed. One-sixth of the rows in the entire table match field<=12, but only one-fifteenth of the rows matching the part/value condition also match field<=12. > There's been some speculation about obtaining stats on partial indexes > as a substitute for solving the general problem of correlation stats, Oh. So my partial index's rowcount isn't being considered at all? That explains a lot. Ok, I'll just run the query with mergejoin and seqscan disabled. (I can't think of much else to do to speed it up, anyway.) Thanks. -- ams