Skip site navigation (1) Skip section navigation (2)

Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Florian Helmberger <fh(at)25th-floor(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
Date: 2011-05-29 02:42:51
Message-ID: BANLkTi=6RYvEVfKn8ufPEf9meGVEu=fHsQ@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-hackers
On Sat, May 28, 2011 at 12:01 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I also found that Greg was right in thinking that it would help if we
> tweaked lazy_scan_heap to not always scan the first
> SKIP_PAGES_THRESHOLD-1 pages even if they were
> all_visible_according_to_vm.  That seemed to skew the results if those
> pages weren't representative.  And, for the case of a useless manual
> vacuum on a completely clean table, it would cause the reltuples value
> to drift when there was no reason to change it at all.

You fixed the logic only for the first 32 pages which helps with the
skew. But really the logic is backwards in general. Instead of
counting how many missed opportunities for skipped pages we've seen in
the past we should read the bits for the next 32 pages in advance and
decide what to do before we read those pages.

-- 
greg

In response to

Responses

pgsql-hackers by date

Next:From: Greg Sabino MullaneDate: 2011-05-29 03:23:56
Subject: Getting a bug tracker for the Postgres project
Previous:From: Josh KupershmidtDate: 2011-05-29 02:38:01
Subject: psql: missing tab completions for COMMENT ON

pgsql-admin by date

Next:From: Tom LaneDate: 2011-05-29 05:10:48
Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
Previous:From: Tom LaneDate: 2011-05-28 19:01:35
Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group