Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1DEB2B5DBDC for ; Wed, 25 May 2011 12:50:07 -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 78576-03 for ; Wed, 25 May 2011 15:49:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4EC4DB5DBDA for ; Wed, 25 May 2011 12:49:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p4PFnv47019786; Wed, 25 May 2011 11:49:57 -0400 (EDT) To: Florian Helmberger cc: pgsql-admin@postgresql.org Subject: Re: pg_class reltuples/relpages not updated by autovacuum/vacuum In-reply-to: <4DD28F73.6010108@25th-floor.com> References: <4DD28F73.6010108@25th-floor.com> Comments: In-reply-to Florian Helmberger message dated "Tue, 17 May 2011 17:08:35 +0200" Date: Wed, 25 May 2011 11:49:57 -0400 Message-ID: <19785.1306338597@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/167 X-Sequence-Number: 37604 Florian Helmberger writes: > I think I've pinned the problem down to the values pg_class holds for > the affected TOAST table: > relpages | 433596 > reltuples | 1868538 > These values are significantly too low. Interestingly, the autovacuum > logout reports the correct values: > pages: 0 removed, 34788136 remain > tuples: 932487 removed, 69599038 remain > but these aren't stored in pg_class after each run. I've moved discussion of this to pgsql-hackers, since this appears to be an actual bug. > Side note: while trying to debug this I've noticed, that the TOAST > chunks on 32-bit systems have the documented size of 2000 bytes, on > 64-bit systems they have 1996 bytes. Is this normal/on purpose? I don't have the exact numbers in my head, but the TOAST chunk size does depend on a MAXALIGN calculation, so it being different between 32- and 64-bit isn't surprising. regards, tom lane