Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id AEB661337B93 for ; Tue, 8 Mar 2011 17:24:37 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 00181-01 for ; Tue, 8 Mar 2011 21:24:30 +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 73B6B1337B82 for ; Tue, 8 Mar 2011 17:24:29 -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 p28LOPPn028148; Tue, 8 Mar 2011 16:24:25 -0500 (EST) To: Robert Haas cc: Merlin Moncure , Ivan Voras , pgsql-performance@postgresql.org Subject: Re: Query performance with disabled hashjoin and mergejoin In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Tue, 08 Mar 2011 15:57:46 -0500" Date: Tue, 08 Mar 2011 16:24:25 -0500 Message-ID: <28147.1299619465@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: 201103/95 X-Sequence-Number: 42774 Robert Haas writes: > The reason I thought cross-column correlations might be relevant is > that the bitmap index scan on news_visible_from is quite accurate > (19976 estimated vs. 19932 actual) and the bitmap index scan on > news_visible_to is tolerably accurate (151 estimated vs. 41 actual) > but the estimate on the BitmapOr is somehow totally wrong (20127 > estimated vs. 0 actual). But on further reflection that doesn't make > much sense. How can the BitmapOr produce fewer rows than the sum of > its constituent inputs? That's not an estimation bug, that's a measurement bug. We don't try to count the actual number of rows present in the result of a BitmapOr or BitmapAnd node. (It would be impractical in lossy cases anyway, not to mention expensive.) regards, tom lane