Re: Visibility map, partial vacuums - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Visibility map, partial vacuums
Date
Msg-id 87ljv9rvv0.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Visibility map, partial vacuums  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Visibility map, partial vacuums  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: Visibility map, partial vacuums  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> I've been thinking that we could add one frozenxid field to each 
>> visibility map page, for the oldest xid on the heap pages covered by the 
>> visibility map page. That would allow more fine-grained anti-wraparound 
>> vacuums as well.
>
> This doesn't strike me as a particularly good idea.  Right now the map
> is only hints as far as vacuum is concerned --- if you do the above then
> the map becomes critical data.  And I don't really think you'll buy
> much.

Hm, that depends on how critical the critical data is. It's critical that the
frozenxid that autovacuum sees is no more recent than the actual frozenxid,
but not critical that it be entirely up-to-date otherwise.

So if it's possible for the frozenxid in the visibility map to go backwards
then it's no good, since if that update is lost we might skip a necessary
vacuum freeze. But if we guarantee that we never update the frozenxid in the
visibility map forward ahead of recentglobalxmin then it can't ever go
backwards. (Well, not in a way that matters)

However I'm a bit puzzled how you could possibly maintain this frozenxid. As
soon as you freeze an xid you'll have to visit all the other pages covered by
that visibility map page to see what the new value should be.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!


pgsql-hackers by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: [PATCHES] Solve a problem of LC_TIME of windows.
Next
From: "Marko Kreen"
Date:
Subject: Re: [bugfix] DISCARD ALL does not release advisory locks