Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Florian Helmberger <fh@25th-floor.com>, pgsql-hackers@postgresql.org, Alvaro Herrera <alvherre@commandprompt.com>
Date: 2011-05-25T17:31:03Z
Lists: pgsql-hackers
On Wed, May 25, 2011 at 1:15 PM, Robert Haas <robertmhaas@gmail.com> wrote: > I agree that if VACUUM scanned 99% of the table, it's probably fine to > use its numbers. It's also fine to use the numbers from ANALYZE, > because those pages are chosen randomly. What bothers me is the idea > of using a small *non-random* sample, and I'm not sure that > incorporating possibly-bogus results slowly is any better than > incorporating them quickly. In particular, unless I'm misremembering, VACUUM *always* scans the first few pages of the table, until it sees enough consecutive all-visible bits that it decides to start skipping. If I'm right about that, then those pages could easily end up being overweighted when VACUUM does the counting; especially if ANALYZE or an actual full-table vacuum aren't allowed to snap the count back to reality. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company