Re: statistics for shared catalogs not updated when autovacuum is off

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: statistics for shared catalogs not updated when autovacuum is off
Дата
Msg-id 56B00898.4010409@BlueTreble.com
обсуждение исходный текст
Ответ на Re: statistics for shared catalogs not updated when autovacuum is off  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: statistics for shared catalogs not updated when autovacuum is off  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On 2/1/16 7:20 PM, Peter Eisentraut wrote:
> That's probably right.  Even with autovacuum on, the statistics for
> shared catalogs do not appear as updated right away.  That is, if you
> run VACUUM and then look at pg_stat_sys_tables right away, you will see
> the stats for shared catalogs to be slightly out of date until the
> minutely autovacuum check causes them to update.
>
> So the problem exists in general, but the autovacuum launcher papers
> over it every minute.

I suspect the issue is in backend_read_statsfile(). Presumably the if 
just needs a call to AutoVacuumingActive() added:

>     /*
>      * Autovacuum launcher wants stats about all databases, but a shallow read
>      * is sufficient.
>      */
>     if (IsAutoVacuumLauncherProcess())
>         pgStatDBHash = pgstat_read_statsfiles(InvalidOid, false, false);
>     else
>         pgStatDBHash = pgstat_read_statsfiles(MyDatabaseId, false, true);

The interesting thing is that we always start the launcher one time, to 
protect against wraparound, but apparently that path doesn't call 
anything that calls backend_read_statsfile() (which is static).
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



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

Предыдущее
От: Euler Taveira
Дата:
Сообщение: Re: Raising the checkpoint_timeout limit
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: "using previous checkpoint record at" maybe not the greatest idea?