Re: Database 'template1' vacuum

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Natalie Wenz <nataliewenz(at)ebureau(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>, Kevin Grittner <kgrittn(at)gmail(dot)com>
Subject: Re: Database 'template1' vacuum
Date: 2016-08-08 16:45:10
Message-ID: 7326.1470674710@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Mon, Aug 8, 2016 at 10:43 AM, Natalie Wenz <nataliewenz(at)ebureau(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bruce Momjian 2016-08-08 20:46:06 Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?
Previous Message David G. Johnston 2016-08-08 15:00:03 Re: Database 'template1' vacuum