From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
Cc: | Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Pluggable cumulative statistics |
Date: | 2024-07-11 07:42:22 |
Message-ID: | Zo-M3mX_ar93MJnh@paquier.xyz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Jul 10, 2024 at 09:00:31AM +0000, Bertrand Drouvot wrote:
> On Wed, Jul 10, 2024 at 08:28:56AM +0000, Bertrand Drouvot wrote:
>> v5-0001 LGTM.
Thanks. I've applied this refactoring piece.
> /*
> * We found an existing statistics file. Read it and put all the hash
> * table entries into place.
> */
Indeed. Reworded that slightly and applied it as well.
So we are down to the remaining parts of the patch, and this is going
to need a consensus about a few things because this impacts the
developer experience when implementing one's own custom stats:
- Are folks OK with the point of fixing the kind IDs in time like
RMGRs with a control in the wiki? Or should a more artistic approach
be used like what I am mentioning at the bottom of [1]. The patch
allows a range of IDs to be used, to make the access to the stats
faster even if some area of memory may not be used.
- The fixed-numbered custom stats kinds are stored in an array in
PgStat_Snapshot and PgStat_ShmemControl, so as we have something
consistent with the built-in kinds. This makes the tracking of the
validity of the data in the snapshots split into parts of the
structure for builtin and custom kinds. Perhaps there are better
ideas than that? The built-in fixed-numbered kinds have no
redirection.
- The handling of both built-in and custom kinds touches some areas of
pgstat.c and pgstat_shmem.c, which is the minimal I could come up
with.
Attached is a rebased patch set with the remaining pieces.
[1]: https://www.postgresql.org/message-id/ZoshTO9K7O7Z1wrX%40paquier.xyz
--
Michael
Attachment | Content-Type | Size |
---|---|---|
v6-0001-Switch-PgStat_Kind-from-enum-to-uint32.patch | text/x-diff | 3.1 KB |
v6-0002-Introduce-pluggable-APIs-for-Cumulative-Statistic.patch | text/x-diff | 20.2 KB |
v6-0003-doc-Add-section-for-Custom-Cumulative-Statistics-.patch | text/x-diff | 3.3 KB |
v6-0004-injection_points-Add-statistics-for-custom-points.patch | text/x-diff | 14.2 KB |
v6-0005-injection_points-Add-example-for-fixed-numbered-s.patch | text/x-diff | 11.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | jian he | 2024-07-11 07:43:00 | Re: Removing unneeded self joins |
Previous Message | cca5507 | 2024-07-11 07:16:13 | Fix a comment error in logicalrep_write_typ() |