Thread: PG_STAT_DATABASE
I am looking into the PostgreSQL dictionary. The view pg_stat_activity is the PgSQL version of v$session. There are interesting views named pg_stat_database and pg_stat_user_tables. What is the starting point for those stat views? Is that since the database and table, in case of the latter view, was created? Is it since the last restart of the instance? I was unable to find that in the documentation.
Here is the description of the view in question:
Here is the description of the view in question:
View "pg_catalog.pg_stat_database" Column | Type | Modifiers ---------------+---------+----------- datid | oid | datname | name | numbackends | integer | xact_commit | bigint | xact_rollback | bigint | blks_read | bigint | blks_hit | bigint | tup_returned | bigint | tup_fetched | bigint | tup_inserted | bigint | tup_updated | bigint | tup_deleted | bigint |
|
Attachment
Mladen Gogala wrote:
There used (pre 8.3 I think) to be a postgresql.conf setting called stats_reset_on_server_start that would determine whether the collected stats would carry across server restarts or be reset. That setting has been removed due to the addition of a reset function called pg_stat_reset() which is (tersely) documented along with a lot of other info on statistics collection at http://www.postgresql.org/docs/8.4/interactive/monitoring-stats.html.
Cheers,
Steve
I am looking into the PostgreSQL dictionary. The view pg_stat_activity is the PgSQL version of v$session. There are interesting views named pg_stat_database and pg_stat_user_tables. What is the starting point for those stat views? Is that since the database and table, in case of the latter view, was created? Is it since the last restart of the instance? I was unable to find that in the documentation....
There used (pre 8.3 I think) to be a postgresql.conf setting called stats_reset_on_server_start that would determine whether the collected stats would carry across server restarts or be reset. That setting has been removed due to the addition of a reset function called pg_stat_reset() which is (tersely) documented along with a lot of other info on statistics collection at http://www.postgresql.org/docs/8.4/interactive/monitoring-stats.html.
Cheers,
Steve