On 2013-05-23 19:51:48 +0200, Andres Freund wrote:
> We currently need to make sure we scanned the whole relation and have
> frozen everything to have a sensible relfrozenxid for a relation.
> 
> So, what I propose instead is basically:
> 1) only vacuum non-all-visible pages, even when doing it for
>    anti-wraparound
> 2) When we can set all-visible guarantee that all tuples on the page are
>    fully hinted. During recovery do the same, so we don't need to log
>    all hint bits.
>    We can do this with only an exclusive lock on the buffer, we don't
>    need a cleanup lock.
> 3) When we cannot mark a page all-visible or we cannot get the cleanup
>    lock, remember the oldest xmin on that page. We could set all visible
>    in the former case, but we want the page to be cleaned up sometime
>    soonish.
> 4) If we can get the cleanup lock, purge dead tuples from the page and
>    the indexes, just as today. Set the page as all-visible.
> 
> That way we know that any page that is all-visible doesn't ever need to
> look at xmin/xmax since we are sure to have set all relevant hint
> bits.

Heikki noticed that I made quite the omission here which is that you
would need to mark tuples as all visible as well. I was thinking about
using HEAP_MOVED_OFF | HEAP_MOVED_IN as a hint for that.

Greetings,

Andres Freund

-- 
 Andres Freund                     http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to