More vacuum.c refactoring

Manfred Koizar <mkoi-pg@aon.at>

From: Manfred Koizar <mkoi-pg@aon.at>
To: pgsql-hackers@postgresql.org
Date: 2004-06-10T20:08:22Z
Lists: pgsql-hackers

Attachments

Near the end of repair_frag() in vacuum.c -- under the comment /* clean
moved tuples from last page in Nvacpagelist list */ -- there is code
that marks itemids as unused.  Itemids affected are those referring to
tuples that have been moved off the last page.

This code is very similar to vacuum_page().  The major difference is
that vacuum_page() uses vacpage->offsets while the code in repair_frag()
looks for MOVED_OFF bits in tuple headers.  AFAICS the tuples with the
MOVED_OFF bit set are exactly those referenced by vacpage->offsets.

The attached patch passes make check and make installcheck.  Please
apply unless I'm missing something.

Servus
 Manfred