Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 973CC1337B56 for ; Tue, 9 Nov 2010 19:29:48 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 09938-08 for ; Tue, 9 Nov 2010 23:29:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 33651133798E for ; Tue, 9 Nov 2010 19:29:41 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oA9NTeQo020389; Tue, 9 Nov 2010 18:29:40 -0500 (EST) To: bricklen cc: pgsql-performance@postgresql.org Subject: Re: Huge overestimation in rows expected results in bad plan In-reply-to: References: Comments: In-reply-to bricklen message dated "Tue, 09 Nov 2010 13:26:47 -0800" Date: Tue, 09 Nov 2010 18:29:40 -0500 Message-ID: <20388.1289345380@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/125 X-Sequence-Number: 41149 bricklen writes: > I have a query that is getting a pretty bad plan due to a massively > incorrect count of expected rows. The query doesn't seem to match the plan. Where is that OR (c.id = 38441828354::bigint) condition coming from? regards, tom lane