Support reset of Shared objects statistics in "pg_stat_reset" function

From: Sadhuprasad Patro <b(dot)sadhu(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Support reset of Shared objects statistics in "pg_stat_reset" function
Date: 2021-08-06 08:26:21
Message-ID: CAFF0-CGy7EHeF=AqqkGMF85cySPQBgDcvNk73G2O0vL94O5U5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

The call to “pg_stat_reset“ does reset all the statistics data for
tables belonging to the current database but does not take care of
shared tables e.g pg_attribute. Similarly to reset the statistics at
table level, the call to “pg_stat_reset_single_table_counters“ does
not take care of shared tables.

When we reset all the statistics using the call “pg_stat_reset”, the
postgres process internally makes calls to “
pgstat_recv_resetcounter“, which resets the statistics of all the
tables of the current database. But not resetting the statistics of
shared objects using database ID as 'InvalidOid'.

The same fix is made in the internal function
“pgstat_recv_resetsinglecounter“ to reset the statistics for the
shared table for the call "pg_stat_reset_single_table_counters".

--
thank u
SADHU PRASAD
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
0001-pg_stat_reset-and-pg_stat_reset_single_table_counter.patch application/octet-stream 3.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-08-06 08:30:07 Re: Added schema level support for publication.
Previous Message houzj.fnst@fujitsu.com 2021-08-06 08:23:09 RE: Parallel Inserts (WAS: [bug?] Missed parallel safety checks..)