I've been trying to get information about the number of inserts, updates and deletes on a table. I found the pg_stat_all_tables view and n_tup_ins/upd/del columns. These will tell me how ma开发者_开发问答ny rows have been added to a table, but I can't find information about these values anywhere. I know they are all really collected from function
pg_stat_get_tuples_inserted(c.oid) AS n_tup_ins,
pg_stat_get_tuples_updated(c.oid) AS n_tup_upd,
pg_stat_get_tuples_deleted(c.oid) AS n_tup_del
The question is, what resets these values in runtime? ( If ever done ... )
Any ideas? Or am I looking in the wrong place?
Cheers /P
Use pg_stat_reset()
to reset them, see the documentation.
For example
$ psql -Umyuser mydb
mydb# SELECT pg_stat_reset();
精彩评论