Re: Support reset of Shared objects statistics in "pg_stat_reset" function

Sadhuprasad Patro <b.sadhu@gmail.com>

From: Sadhuprasad Patro <b.sadhu@gmail.com>
To: Mahendra Singh Thalor <mahi6run@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, Himanshu Upadhyaya <upadhyaya.himanshu@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-08-10T16:23:22Z
Lists: pgsql-hackers

Attachments

> As of now, we are adding handling inside pg_stat_reset for shared
> tables but I think we can add a new function with the name of
> pg_stat_reset_shared_tables to reset stats for all the shared tables.
> New function will give more clarity to the users also. We already have
> a pg_stat_reset_shared(text) function for "archiver", "bgwriter", or
> "wal".
>
> Thoughts?

In my opinion, it is better to extend the functionality of
"pg_stat_reset" call because a new function just to reset shared table
data may not be needed. Where we already have a reset shared function
"pg_stat_reset_shared" in place.

All of applicable comments are implemented in the patch below:


Thanks & Regards
SadhuPrasad
EnterpriseDB: http://www.enterprisedb.com

Commits

  1. Enhance pg_stat_reset_single_table_counters function.