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.
>