Re: Setting visibility map in VACUUM's second phase

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Pavan Deolasee <pavan.deolasee@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-12-06T18:57:39Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> One other thought: I'm wondering if we shouldn't try to push the work
> of setting the all-visible bit into heap_page_prune().

Hm, maybe ...

>  But it seems to me that a page can't be all-visible unless there are
> no dead line pointers and no HOT chains of length != 1, and
> heap_prune_chain() does manage to call HeapTupleSatisfiesVacuum() for
> every tuple, so the raw information seems like it is available without
> any additional CLOG lookups.

HeapTupleSatisfiesVacuum is interested in whether a dead tuple is dead
to everybody, but I don't think it figures out whether a live tuple is
live to everybody.  On the assumption that most tuples are live, adding
the latter calculation might represent significant expense.

			regards, tom lane