Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6E9829FB62D for ; Wed, 10 Oct 2007 16:36:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 88535-04 for ; Wed, 10 Oct 2007 16:36:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id 696579FB4BD for ; Wed, 10 Oct 2007 16:36:16 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Wed, 10 Oct 2007 14:36:15 -0500 Message-Id: <470CE34D.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 Date: Wed, 10 Oct 2007 14:35:58 -0500 From: "Kevin Grittner" To: "Simon Riggs" Cc: ,"Tom Lane" Subject: Re: hashjoin chosen over 1000x faster plan References: <470B99BE.EE98.0025.0@wicourts.gov> <1191997904.4233.125.camel@ebony.site> <470C9813.EE98.0025.0@wicourts.gov> <1192035955.4233.306.camel@ebony.site> <1192035955.4233.306.camel@ebony.site> <20980.1192039650@sss.pgh.pa.us> <470CD3E3.EE98.0025.0@wicourts.gov> <1192042492.4233.334.camel@ebony.site> In-Reply-To: <1192042492.4233.334.camel@ebony.site> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/106 X-Sequence-Number: 27128 >>> On Wed, Oct 10, 2007 at 1:54 PM, in message <1192042492.4233.334.camel@ebony.site>, Simon Riggs = wrote:=20 >=20 > But the planner doesn't work on probability. It works on a best-guess > selectivity, as known at planning time. =20 The point I'm trying to make is that at planning time the pg_statistic row for this "Charge"."reopHistSeqNo" column showed stanullfrac as 0.989; it doesn't seem to have taken this into account when making its guess about how many rows would be joined when it was compared to the primary key column of the "CaseHist" table. I'm suggesting that it might be a good thing if it did. =20 -Kevin =20