ANALYZE counts LP_DEAD line pointers as n_dead_tup

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема ANALYZE counts LP_DEAD line pointers as n_dead_tup
Дата
Msg-id CAD21AoBwkgvxiR13Atr=49TFf_thvZttzOsVZp-eRu8Bz+u9dg@mail.gmail.com
обсуждение исходный текст
Ответы Re: ANALYZE counts LP_DEAD line pointers as n_dead_tup
Список pgsql-hackers
Hi all,

If we create a table with vacuum_index_cleanup = off or execute VACUUM
with INDEX_CLEANUP = off, vacuum updates pg_stat_all_tables.n_dead_tup
to the number of HEAPTUPLE_RECENTLY_DEAD tuples. Whereas analyze
updates it to the sum of the number of HEAPTUPLE_DEAD/RECENTLY_DEAD
tuples and LP_DEAD line pointers. So if the table has many LP_DEAD
line pointers due to skipping index cleanup, autovacuum is triggered
every time after analyze/autoanalyze. This issue seems to happen also
on back branches, probably from 12 where INDEX_CLEANUP option was
introduced.

I think we can have heapam_scan_analyze_next_tuple() not count LP_DEAD
line pointer as lazy_scan_prune() does. Attached the patch for that.

Regards,

-- 
Masahiko Sawada
EDB:  https://www.enterprisedb.com/

Вложения

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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Can a child process detect postmaster death when in pg_usleep?
Следующее
От: "Mead, Scott"
Дата:
Сообщение: Re: [BUG] Autovacuum not dynamically decreasing cost_limit and cost_delay