X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 66A76475D0F for ; Sun, 20 Apr 2003 06:07:49 -0400 (EDT) Received: from smtp.web.de (smtp01.web.de [217.72.192.180]) by postgresql.org (Postfix) with ESMTP id 9C8EC47580B for ; Sun, 20 Apr 2003 06:07:48 -0400 (EDT) Received: from p50818c34.dip0.t-ipconnect.de ([80.129.140.52] helo=web.de) by smtp.web.de with asmtp (TLSv1:RC4-MD5:128) (WEB.DE(Exim) 4.97 #53) id 197Bji-0001Ux-00 for pgsql-performance@postgresql.org; Sun, 20 Apr 2003 12:07:50 +0200 Message-ID: <3EA27179.6010307@web.de> Date: Sun, 20 Apr 2003 12:07:53 +0200 From: Andreas Pflug User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: [SQL] Yet Another (Simple) Case of Index not used References: <200304090918.45275.josh@agliodbs.com> <20030419130146.GI1847@filer> <21955.1050767928@sss.pgh.pa.us> <20030420011336.GJ1847@filer> <24735.1050809664@sss.pgh.pa.us> <20030420062852.GK1847@filer> In-Reply-To: <20030420062852.GK1847@filer> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-34.4 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,RCVD_IN_NJABL, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/177 X-Sequence-Number: 1683 Kevin Brown wrote: > >No, but an MVCC-managed counter would be useful in such a system, >wouldn't it? Or am I missing something there, too (the deltas >themselves would be managed as described, and would be applied as >described)? > >So: how much contention would there be if the counter were managed in >exactly the same way as any row of a table is managed? Because I'm >not terribly familiar with how PG manages MVCC (pointers to >documentation on it welcomed) I can't answer that question myself. > > > It looks to me that a "row number -1" really would solve this problem. I think a row counter on each table would be even useful for some kind of auto-vacuum mechanism, that could be triggered if pg_class.reltuples deviates too far from the real row count. Observing this mailing list, missing or outdated statistics still seem to be a major source of performance degradation. We all know these 1000 row estimates from EXPLAIN, don't we? A default vacuum strategy for pgsql newbies should solve a lot of those problems, preventing a lot of "pgsql is slow" threads. Regards, Andreas