Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 351E9B5DC44 for ; Wed, 25 May 2011 14:37: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 65535-02 for ; Wed, 25 May 2011 17:37:13 +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 9D132B5DC1D for ; Wed, 25 May 2011 14:37:13 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 65A6C348045; Wed, 25 May 2011 10:37:12 -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 FxcTDVio2TBY; Wed, 25 May 2011 10:37:10 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [190.95.22.219]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 4AB9C348044; Wed, 25 May 2011 10:37:10 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D5C936E3FB; Wed, 25 May 2011 13:37:07 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: Kevin Grittner , Tom Lane , Florian Helmberger , pgsql-hackers Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum From: Alvaro Herrera To: =?utf-8?q?C=C3=A9dric_Villemain?= In-reply-to: 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> <1306342228-sup-2964@alvh.no-ip.org> Date: Wed, 25 May 2011 13:37:07 -0400 Message-Id: <1306344946-sup-417@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=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/1299 X-Sequence-Number: 188333 Excerpts from Cédric Villemain's message of mié may 25 13:24:01 -0400 2011: > > 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. > I may miss something but we need relation size in costsize.c even if > we have a reldensity (or we need a reltuples). Else what values should > be used to estimate the relation size ? (pg_relation_size() goes down > to kernel/fs to ask the stat.st_size, is it really what we want?) Actually yes, the planner does go to kernel to determine the current relation size, and then multiplies by density as computed from catalog data to figure out current reasonably accurate number of tuples. -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support