Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id EA2481337B51 for ; Fri, 21 Jan 2011 16:22:35 -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 37409-07 for ; Fri, 21 Jan 2011 20:22:28 +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 3E1D91337B2F for ; Fri, 21 Jan 2011 16:22:28 -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 p0LKMPQa019624; Fri, 21 Jan 2011 15:22:25 -0500 (EST) To: "Kevin Grittner" cc: "Robert Haas" , "Achilleas Mantzios" , pgsql-performance@postgresql.org Subject: Re: "NOT IN" substantially slower in 9.0.2 than 8.3.13 - NOT EXISTS runs fast in both 8.3.13 and 9.0.2 In-reply-to: <4D39918C02000025000399DE@gw.wicourts.gov> References: <955263366.48014741295283147090.JavaMail.root@ucimail4.uci.cu> <201101191110.05268.achill@matrix.gatewaynet.com> <21792.1295458016@sss.pgh.pa.us> <201101200905.26400.achill@matrix.gatewaynet.com> <17201.1295638006@sss.pgh.pa.us> <4D39918C02000025000399DE@gw.wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Fri, 21 Jan 2011 14:00:44 -0600" Date: Fri, 21 Jan 2011 15:22:24 -0500 Message-ID: <19623.1295641344@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: 201101/206 X-Sequence-Number: 41993 "Kevin Grittner" writes: > Tom Lane wrote: >> If it should be less than 1, then what? > 1 - (estimated tuples / estimated distinct values) ? Uh, no. The number we're after is the probability that an outer tuple has at least one unequal value in the inner relation. This is not 1 minus the probability that a *specific* inner value is equal, which is what I think your formula is estimating. regards, tom lane