Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?
Дата
Msg-id 2376063.1650312644@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?
Список pgsql-hackers
Peter Geoghegan <pg@bowt.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Why does pg_class.reltuples count only live tuples in indexes (after VACUUM runs)?