Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E31721337BD8 for ; Thu, 17 Mar 2011 12:05:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 19508-07 for ; Thu, 17 Mar 2011 15:05:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 40E981337BF8 for ; Thu, 17 Mar 2011 12:05:11 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 17 Mar 2011 10:05:10 -0500 Message-Id: <4D81DCCE020000250003BA27@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Thu, 17 Mar 2011 10:05:02 -0500 From: "Kevin Grittner" To: "Kenneth Marshall" Cc: "Derrick Rice" , Subject: Re: Updating histogram_bounds after a delete References: <4D80EBAB020000250003B9DE@gw.wicourts.gov> <4D81D939020000250003BA22@gw.wicourts.gov> <20110317145529.GK11541@aart.is.rice.edu> In-Reply-To: <20110317145529.GK11541@aart.is.rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/186 X-Sequence-Number: 42865 Kenneth Marshall wrote: > I think this is it: > > http://archives.postgresql.org/pgsql-committers/2010-01/msg00021.php Looks like it. Based on the commit date, that would be a 9.0 change. Based on the description, I'm not sure it fixes Derrick's problem; the workaround of explicitly using min() for the low end of a range may need to be a long-term approach. It does seem odd, though, that the statistics would be off by that much. Unless the query is run immediately after a mass delete, autovacuum should be fixing that. Perhaps the autovacuum improvements in later releases will solve the problem. If not, an explicit ANALYZE (or perhaps better, VACUUM ANALYZE) immediately after a mass delete would be wise. -Kevin