Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM
Дата
Msg-id 84941.1691587094@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
Peter Geoghegan <pg@bowt.ie> writes:
> On Tue, Aug 8, 2023 at 8:43 PM Justin Pryzby <pryzby@telsasoft.com> wrote:
>> The problem isn't that reltuples == -1 after the upgrade (which is
>> normal).  The issue is that if VACUUM skips all the pages, it can leave
>> reltuples -1.  My expectation is that after running "vacuum", no tables
>> are left in the "never have been vacuumed" state.

> But -1 isn't the "never have been vacuumed" state, exactly. At best it
> is the "never been vacuumed or analyzed" state.

Yeah.  -1 effectively pleads ignorance about the number of live tuples.
If VACUUM has skipped every page, then it is still ignorant about
the true number of live tuples, so setting the value to something
else would be inappropriate.

Perhaps, though, there's a case for forcing all pages to be visited
if we start with reltuples == -1?  I'm not sure it matters much
though given that you also need an ANALYZE run to be really in a
good place after pg_upgrade.  The ANALYZE should update this.

            regards, tom lane



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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: initial pruning in parallel append
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Separate memory contexts for relcache and catcache