Re: Use pgstat_kind_infos to read fixed shared stats structs

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tristan Partin <tristan(at)neon(dot)tech>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use pgstat_kind_infos to read fixed shared stats structs
Date: 2024-07-02 03:23:34
Message-ID: ZoNytpoHOzHGBLYi@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 01, 2024 at 02:48:19PM +0900, Michael Paquier wrote:
> So, how about trying to remove the dependency to the fixed shared
> stats structures in PgStat_ShmemControl and PgStat_Snapshot? I'd like
> to think that these should be replaced with an area allocated in
> shared memory and TopMemoryContext respectively, with PgStat_Snapshot
> and PgStat_ShmemControl pointing to these areas, with an allocated
> size based on the information aggregated from the KindInfo Array. We
> could also store the offset of the fixed areas in two extra arrays,
> one for each of the two structures, indexed by KindInfo and of size
> PGSTAT_NUM_KINDS.

I have been poking at this area, and found a solution that should
work. The details will be posted on the pluggable stats thread with a
rebased patch and these bits on top of the pluggable APIs:
https://www.postgresql.org/message-id/Zmqm9j5EO0I4W8dx%40paquier.xyz

So let's move the talking there.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiro.Ikeda 2024-07-02 03:44:01 RE: Improve EXPLAIN output for multicolumn B-Tree Index
Previous Message David Rowley 2024-07-02 01:48:28 Re: Should we document how column DEFAULT expressions work?