X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E182A52A50 for ; Thu, 24 Mar 2005 19:22:28 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36823-04 for ; Thu, 24 Mar 2005 19:22:23 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id CB46F5343F for ; Thu, 24 Mar 2005 19:22:22 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j2OJMMA8004842; Thu, 24 Mar 2005 14:22:22 -0500 (EST) To: Keith Browne , pgsql-bugs@postgresql.org, andrew@supernews.com, "Brian O'Reilly" Subject: Re: BUG #1552: massive performance hit between 7.4 and 8.0.1 In-reply-to: <14846.1111616020@sss.pgh.pa.us> References: <20050318232102.08FA0F0E5D@svr2.postgresql.org> <1111567230.11750.596.camel@localhost.localdomain> <4241C1DF.2020000@deepsky.com> <13841.1111608763@sss.pgh.pa.us> <4241D7AB.4030607@deepsky.com> <14846.1111616020@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 23 Mar 2005 17:13:40 -0500" Date: Thu, 24 Mar 2005 14:22:22 -0500 Message-ID: <4841.1111692142@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/259 X-Sequence-Number: 11379 I wrote: > ... Maybe we could > put in a hack that detects whether a table has yet been vacuumed, and > sets 10/1000 as the minimum stats --- not fixed values, but minimum > values that can be overridden when the table is actually larger --- > until it has been vacuumed. For lack of any better suggestions, I've done this in HEAD and 8.0 branches. It proved simplest to just limit the page estimate to be at least 10 pages when relpages == 0. The tuple estimate will be derived from that using pre-existing code that estimates the average tuple size. regards, tom lane