Re: Add stats_reset to pg_stat_all_tables|indexes and related views

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-10-06T06:33:41Z
Lists: pgsql-hackers
On Fri, Oct 03, 2025 at 10:03:32AM +0000, Bertrand Drouvot wrote:
> That makes sense. Done in 0001 attached.

Done this one, with a tweak to use directly the index name, which is a
primary key from the test table.

> Thanks! Attached v3, split in 2 sub patches as discussed above (0002 is same
> as v2 except that the tests has been changed due to 0001).

And applied this one as well after a few tweaks, mainly consistency in
the code, with what should be the proper format bumps (thanks for the
notes in your proposed commit message). 
--
Michael

Commits

  1. Add stats_reset to pg_stat_user_functions

  2. Add stats_reset to pg_stat_all_{tables,indexes} and related views

  3. Add test for pg_stat_reset_single_table_counters() on index