Visibility map and freezing

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Visibility map and freezing
Дата
Msg-id 4948C911.7080901@enterprisedb.com
обсуждение исходный текст
Ответы Re: Visibility map and freezing  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Re: Visibility map and freezing  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
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.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: WAL documentation changes
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: visibility maps