Re: [GENERAL] Postgres 9.x table/index stats reset timestamp

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [GENERAL] Postgres 9.x table/index stats reset timestamp
Дата
Msg-id CAB7nPqR3BCVz-gi5DiVmK9giFtxtmYfktbf3D69QNFYxfPk2_A@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Postgres 9.x table/index stats reset timestamp  (Dave Quello <dquello@gmail.com>)
Список pgsql-general
On Fri, Mar 3, 2017 at 3:03 AM, Dave Quello <dquello@gmail.com> wrote:
> Function pg_stat_reset_single_table_counters() resets stats for a single
> table/index that you typically query through pg_stat_user_tables or
> pg_stat_user_indexes, but there is no apparent way to retrieve the timestamp
> of the reset.  All stats in the db can be reset using pg_stat_reset() and
> the last reset date can be retrieved from pg_stat_database, but I’d prefer
> not to reset ALL stats when the focus is on a particular table/index.
>
> Are individual table/index reset timestamps stored?  If so, can they be
> retrieved?

The reset timestamp of each table entry is unfortunately not stored,
look at PgStat_StatTabEntry to see what's stored. Well we could have
that as well, it is important to be careful that the reset is updated
for all tables. Note that the timestamp reset happens in pgstat.c
actually. What you could do for now is to use a wrapper on top of
pg_stat_reset_single_table_counters() that calls now() and stores
timestamp on a custom table storing (oid,timestamp).
--
Michael


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: [GENERAL] PG on SSD
Следующее
От: rob stone
Дата:
Сообщение: Re: [GENERAL] CentOS 7.3, PostgreSQL 9.6.2, PHP 5.4 deliver arrayas string