From: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | Sami Imseih <samimseih(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: Add stats_reset to pg_stat_all_tables|indexes and related views |
Date: | 2025-10-03 10:03:32 |
Message-ID: | aN+fdN6L8mN2YbzE@ip-10-97-1-34.eu-west-3.compute.internal |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On Fri, Oct 03, 2025 at 04:50:07PM +0900, Michael Paquier wrote:
> On Fri, Oct 03, 2025 at 05:33:00AM +0000, Bertrand Drouvot wrote:
> > On Fri, Oct 03, 2025 at 10:24:39AM +0900, Michael Paquier wrote:
> >> Makes sense to me. This matters in terms of coverage for HEAD,
> >> being outside of the scope of this proposal.
> >
> > Added one test on pg_stat_all_indexes in v2 attached. That's the first test
> > on "pg_stat_all_indexes" in .sql files. It just tests the new stats_reset field,
> > I think it's sufficient for the purpose of this patch.
>
> But the fact that the reset function is able to work on indexes is
> something separate than this patch. Wouldn't it be better to check
> some of the non-timestamp fields of pg_stat_all_indexes with a reset
> in a test that applies before the main patch?
Yeah, stats.sql is already doing some tests coverage on index stats (through
retrieving idx_scan and friends in pg_stat_all_tables) but the reset function
is not tested explicitly on indexes.
> That's a minor comment,
> sure, but this part feels like a separate item. So I'd like to
> extract that as a patch of its own, then apply it as an independent
> piece.
That makes sense. Done in 0001 attached.
> > Yeah, it comes from 083e1b0f27df and the associated discussion is [1]. From what
> > I can see, at that time the struct that was holding the table and index stats
> > was "PgStat_TableCounts". So the naming "pg_stat_reset_single_table_counters"
> > somehow made more sense at that time.
>
> Thanks for the history digging.
>
> I have double-checked the whole patch, at it looks like you have the
> right coverage in terms of the docs and the system views, impacting
> the set of system views for pg_stat_{all,user,sys}_{tables,indexes},
> and same for the pg_statio_* counterparts. So things look clear here.
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).
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachment | Content-Type | Size |
---|---|---|
v3-0001-Add-basic-coverage-for-pg_stat_reset_single_table.patch | text/x-diff | 2.7 KB |
v3-0002-Add-stats_reset-to-pg_stat_all_tables-indexes-and.patch | text/x-diff | 18.3 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | David Rowley | 2025-10-03 10:06:02 | Re: [PATCH] Add tests for Bitmapset |
Previous Message | David Rowley | 2025-10-03 09:36:48 | Fixing a few minor misusages of bms_union() |