Re: Reset DB stats suggestion pg_stat_reset() - Mailing list pgsql-general

From Michael Lewis
Subject Re: Reset DB stats suggestion pg_stat_reset()
Date
Msg-id CAHOFxGpmuqYMxKq9bk0G7Hs7n=4KR8+Yea+Cr9+J-gLe2KcGwQ@mail.gmail.com
Whole thread Raw
In response to Reset DB stats suggestion pg_stat_reset()  (postggen2020 s <postggen2020@gmail.com>)
List pgsql-general
We have seen some deadlocks and tempfile count in pg_stat_database view. We are trying to reset the stats. 
Can we use pg_stat_reset() function to reset these stats without any impact stats of databases.
Please advise the process to reset the stats.

Yes, you could reset stats every month or week or whatever you decide makes sense so you have an understanding of the timeline. Else, knowing that an index has been used X times since who-knows-when is not a very useful piece of information. I have occasionally reset the stats on all indexes on a table when adding or removing an index from that table so that I have an accurate idea of whether index_xyz or index_abc gets used. You can take a snapshot of the stats on the table occasionally and compare prior count to new count if you prefer. I find reset to be cleaner.

pgsql-general by date:

Previous
From: bvo
Date:
Subject: Re: backup broken
Next
From: Mani Sankar
Date:
Subject: LDAP with TLS is taking more time in Postgresql 11.5