Re: Visibility map and freezing

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Visibility map and freezing
Date: 2008-12-17 12:47:01
Message-ID: 4948F4C5.30007@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

What's about add second bit which mark frozen page (all tuples have freeze XID)?
It should avoid full scan, but extend size of map.

Zdenek

Heikki Linnakangas napsal(a):
> The way VACUUM works with the visibility map is that if any pages are
> skipped, relfrozenxid can't be updated. That means that plain VACUUM
> won't advance relfrozenxid, and doesn't protect from XID wraparound.
>
> We discussed this in the context of autovacuum before, and we have that
> covered now. Autovacuum will launch a full-scanning vacuum that advances
> relfrozenxid, when autovacuum_freeze_max_age is reached, and partial
> vacuums otherwise.
>
> Autovacuum will launch anti-wraparound vacuum even if it's otherwise
> disabled. Which is good, but it'll be an unpleasant surprise for someone
> who performs a simple manual database-wide "VACUUM", for example, every
> night from a cron job. You could run VACUUM FREEZE, say monthly, to
> force a full-scanning vacuum, but that's unnecessarily aggressive, and
> you need to know about the issue to set that up in the first place.
>
> I think we need a threshold similar to autovacuum_freeze_max_age for
> manual vacuums as well: vacuum_freeze_max_age. If you run VACUUM, and
> relfrozenxid is older than vacuum_freeze_max_age, the visibility map is
> ignored and all pages are scanned.
>
> This ensures that you don't run into forced anti-wraparound autovacuums
> if you do your VACUUMs manually.
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-12-17 12:53:50 Re: parallel restore vs. windows
Previous Message Andrew Dunstan 2008-12-17 12:40:20 Re: Looking for someone with MinGW