How to identify whether the stats were reset?

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема How to identify whether the stats were reset?
Дата
Msg-id 4CE5F8BF.3010607@fuzzy.cz
обсуждение исходный текст
Ответы Re: How to identify whether the stats were reset?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello everyone,

we're collecting snapshots of the statistics (pg_stat, pg_statio etc.)
regularly so that we can analyze the performance, detect trends etc.

We need to identify whether the stats were reset between the snapshots,
because then the collected data are useless (and the scripts that do the
analysis are quite confused).

Thanks to pg_postmaster_start_time it's quite simple to find out whether
the postmaster was restarted (before 8.3 that may reset the stats if
stats_reset_on_server_start=true).

But is there a way to find out whether the statistics were reset using
pg_stat_reset_* functions? E.g. 'timestamp of the last reset' or
something like that?

Currently I'm comparing some of the cumulative values (e.g. n_commits)
and if the newer version is lower than the old one, it's considered as a
proof that the stats were reset.

But I don't like this solution and it does not detect resets of
statistics for a single table, function or a bgwriter :-(

But is there a better way?


regards
Tomas

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

Предыдущее
От: Jayadevan M
Дата:
Сообщение: Re: Survey on backing up unlogged tables: help us with PostgreSQL development!
Следующее
От: Sachin Srivastava
Дата:
Сообщение: Re: How to install in windows 2000