Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 45CAB1337FA4 for ; Thu, 16 Sep 2010 15:39:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 09210-02 for ; Thu, 16 Sep 2010 18:39:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from glacier.frostconsultingllc.com (glacier.frostconsultingllc.com [69.36.227.170]) by mail.postgresql.org (Postfix) with ESMTP id 2401C1337EEE for ; Thu, 16 Sep 2010 15:39:27 -0300 (ADT) Received: from dsl081-245-111.sfo1.dsl.speakeasy.net ([64.81.245.111] helo=Sidney-Stratton.local) by glacier.frostconsultingllc.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.69) (envelope-from ) id 1OwJMh-0002pl-2J for pgsql-performance@postgresql.org; Thu, 16 Sep 2010 11:39:26 -0700 Message-ID: <4C92645A.1040208@agliodbs.com> Date: Thu, 16 Sep 2010 11:39:22 -0700 From: Josh Berkus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Where does data in pg_stat_user_tables come from? References: <4C8EAE5E.70201@agliodbs.com> <1284421288.28610.501.camel@jd-desktop.unknown.charter.com> <4C8EB813.6070204@agliodbs.com> <1284423128.28610.592.camel@jd-desktop.unknown.charter.com> <4C8EC79F.9080404@agliodbs.com> <1284436337-sup-9871@alvh.no-ip.org> In-Reply-To: <1284436337-sup-9871@alvh.no-ip.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201009/107 X-Sequence-Number: 40310 > It's been pure nonsense in this thread. Please show an example of > what's not working. 1) Init a postgresql 8.3 with autovacuum disabled. 2) Load a backup of a database into that PostgreSQL. 3) Check pg_stat_user_tables. n_live_tup for all tables will be 0. 4) VACUUM ANALYZE the whole database. 5) n_live_tup will *still* be 0. Whereas reltuples in pg_class will be reasonable accurate. > Um ... it updates the last_autovacuum and last_autoanalyze columns, > but the others are not its responsibility. Right. I'm contending that ANALYZE *should* update those columns. Current behavior is unintuitive and makes the stats in pg_stat_user_tables almost useless, since you can never get even approximately a coherent snapshot of data for all tables. -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com