Currently we don't have such feature to rest statistics on cluster level. You have to use two PostgreSQL functions like pg_stat_reset_shared(text), pg_stat_reset ().
There are a few statistics that are only kept on a per-cluster basis, such as those reported in pg_stat_* and pg_stat_bgwriter. Since pg_stat_reset only resets per-database statistics.
psql=# select pg_stat_reset(); -- Reset all statistics counters for the current database to zero (requires superuser privileges)
psql=# select pg_stat_reset_shared('bgwritter'); -- It will reset the statistics shown by pg_stat_bgwritter.
In PostgreSQL 9.1,You can now know when stats have been reset last. For a database, for instance:
psql=# SELECT datname, stats_reset FROM pg_stat_database;
datname | stats_reset
-----------+-------------------------------
template1 |
template0 |
postgres | 2012-03-29 19:22:05.946641+02
test | 2012-03-29 19:22:09.133483+02
No comments:
Post a Comment