Peter Geoghegan <pg(at)bowt(dot)ie> writes:
> I think that this doesn't really belong here; new_rel_tuples should
> only be used for VACUUM VERBOSE/server log output, once we return to
> heap_vacuum_rel from lazy_scan_heap. We should use
> vacrel->new_live_tuples as our IndexVacuumInfo.num_heap_tuples value
> in the amvacuumcleanup path (instead of new_rel_tuples). That way the
> rule about IndexVacuumInfo.num_heap_tuples is simple: it's always
> taken from pg_class.reltuples (for the heap rel). Either the existing
> value, or the new value.
The places where index AMs refer to num_heap_tuples seem to be using
it as a ceiling on estimated index tuple counts. Given that we should
be counting dead index entries, redefining it as you suggest would be
wrong.
regards, tom lane