Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8E1151336B42 for ; Mon, 24 Jan 2011 11:40:50 -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 55130-03 for ; Mon, 24 Jan 2011 15:40:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id EA7D9133655C for ; Mon, 24 Jan 2011 11:40:42 -0400 (AST) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id p0OFefTQ084282 for ; Mon, 24 Jan 2011 17:40:41 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id p0OFee0P084281 for pgsql-performance@postgresql.org; Mon, 24 Jan 2011 17:40:40 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: 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 Date: Mon, 24 Jan 2011 17:40:40 +0200 User-Agent: KMail/1.9.7 References: <955263366.48014741295283147090.JavaMail.root@ucimail4.uci.cu> <4D39918C02000025000399DE@gw.wicourts.gov> <19623.1295641344@sss.pgh.pa.us> In-Reply-To: <19623.1295641344@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201101241740.40868.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.451 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_BRBL_LASTEXT=1.449 X-Spam-Level: X-Archive-Number: 201101/214 X-Sequence-Number: 42001 =CE=A3=CF=84=CE=B9=CF=82 Friday 21 January 2011 22:22:24 =CE=BF/=CE=B7 Tom = Lane =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > "Kevin Grittner" writes: > > Tom Lane wrote: > >> If it should be less than 1, then what? > =20 > > 1 - (estimated tuples / estimated distinct values) ? >=20 > 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. Isn't this probablity (an outer tuple has at least one unequal value in the= inner relation)=20 =3D 1 - (probability that all values in the inner relation are equal to the= value of the outer tuple) Anyways, glad to see smth came out of this. Thx >=20 > regards, tom lane >=20 =2D-=20 Achilleas Mantzios