Re: [HACKERS] Queuing all tables for analyze after recovery

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: [HACKERS] Queuing all tables for analyze after recovery
Дата
Msg-id 9ab62594-e8fc-b216-b0bf-5b8b69f83221@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Queuing all tables for analyze after recovery  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Queuing all tables for analyze after recovery  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 10/19/2017 10:54 PM, Tom Lane wrote:
> Tomasz Ostrowski <tometzky+pg@ato.waw.pl> writes:
>> Some (maybe all) row statistics are lost after the database has 
>> recovered after a failover. So it's recommended to ANALYZE all databases 
>> in a cluster after recovery.
> 
> Uh ... recommended by whom?  pg_statistic has exactly the same reliability
> guarantees as the rest of the system catalogs.
> 
> I don't deny that there might be cases where this is worth doing, but
> it does not seem so likely that it should be part of one's standard
> checklist.  Much less something that we should expend a great deal
> of effort to automate.

For data statistics, sure.  One thing I'm unhappy about is that
pg_stat_all_tables is blank.

An idea I've been throwing around in my head is to have autovacuum work
on tables that have vacuum_count and autovacuum_count both zero (and
likewise for analyze).

This will cause a flurry of activity after failover or crash, but the
alternative is autovacuum not knowing anything about the state of the
tables and allowing massive bloat to potentially occur.

For example, if you have a 1 billion row table, and crash when there are
199,999,999 dead tuples, you currently get to wait for another 200
million to die before anything gets cleaned up.
-- 
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Queuing all tables for analyze after recovery
Следующее
От: Tomasz Ostrowski
Дата:
Сообщение: Re: [HACKERS] Queuing all tables for analyze after recovery