Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id EB2D5B5DC38 for ; Wed, 25 May 2011 13:55:22 -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 29850-01 for ; Wed, 25 May 2011 16:55:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 08924B5DC36 for ; Wed, 25 May 2011 13:55:15 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 12F2F348045; Wed, 25 May 2011 09:55:15 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DTus2HMmyenj; Wed, 25 May 2011 09:55:13 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [190.95.22.219]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id D767E348044; Wed, 25 May 2011 09:55:12 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C88686E3FB; Wed, 25 May 2011 12:55:09 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: Tom Lane , Florian Helmberger , pgsql-hackers Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum From: Alvaro Herrera To: Kevin Grittner In-reply-to: <4DDCE9F4020000250003DC48@gw.wicourts.gov> References: <4DD28F73.6010108@25th-floor.com> <25017.1306291669@sss.pgh.pa.us> <4DDCA801.70805@25th-floor.com> <19738.1306338472@sss.pgh.pa.us> <1306339028-sup-6948@alvh.no-ip.org> <22173.1306340636@sss.pgh.pa.us> <4DDCE9F4020000250003DC48@gw.wicourts.gov> Date: Wed, 25 May 2011 12:55:09 -0400 Message-Id: <1306342228-sup-2964@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-5 required=5 tests=none X-Spam-Level: X-Archive-Number: 201105/1282 X-Sequence-Number: 188316 Excerpts from Kevin Grittner's message of mié may 25 12:37:24 -0400 2011: > Tom Lane wrote: > > > I don't know what client-side code might be looking at > > relpages/reltuples. > > I know that I find reltuples useful for getting an "accurate enough" > sense of rows in a table (or set of tables) without resorting to > count(*). I'd be OK with any two of pages, tuples, and density; but > dropping to one would make databases harder to manage, IMV. > > Personally, I don't have much code that uses those columns; > eliminating an existing column wouldn't involve much pain for me as > long as it could still be derived. Well, we only actually need to store one number, because you can figure out a much more precise number-of-pages figure with pg_relation_size() divided by configured page size. (We feel free to hack around catalogs in other places, and we regularly break pgAdmin and the like when we drop columns -- people just live with it and update their tools. I don't think it's such a big deal in this particular case.) -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support