Re: Database 'template1' vacuum - Mailing list pgsql-admin

From Tom Lane
Subject Re: Database 'template1' vacuum
Date
Msg-id 7326.1470674710@sss.pgh.pa.us
Whole thread Raw
In response to Re: Database 'template1' vacuum  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-admin
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Aug 8, 2016 at 10:43 AM, Natalie Wenz <nataliewenz@ebureau.com>
> wrote:
>> How are static tables handled? Once every row in a table is marked as
>> frozen, and there are no further inserts, deletes, updates, etc to the
>> table, does the vacuum have to do anything to that table when advancing the
>> relfrozenxid? Is there a way that the vacuum can see "Oh, this whole table
>> is frozen, my work here is done!" or does it still have to scan every page
>> (or worse, every row)?

> Seems so:
> https://wiki.postgresql.org/wiki/VacuumHeadaches

FWIW, this is due to get better in 9.6.  Per release notes:

    Avoid re-vacuuming pages containing only frozen tuples (Masahiko
    Sawada, Robert Haas, Andres Freund)

    Formerly, an anti-wraparound vacuum had to visit every page of a
    table whether or not there was anything to do there. Now, pages
    containing only already-frozen tuples are identified in the
    table's visibility map, and can be skipped by vacuum even when
    it's doing transaction wraparound prevention. This should greatly
    reduce the cost of maintaining large tables containing
    mostly-unchanging data.

            regards, tom lane


pgsql-admin by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Database 'template1' vacuum
Next
From: Bruce Momjian
Date:
Subject: Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?