Re: Add pg_stat_kind_info system view - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add pg_stat_kind_info system view
Date
Msg-id akS8mpyTBLp7q0w3@paquier.xyz
Whole thread
In response to Re: Add pg_stat_kind_info system view  (Sami Imseih <samimseih@gmail.com>)
Responses Re: Add pg_stat_kind_info system view
List pgsql-hackers
On Tue, Jun 30, 2026 at 11:17:29PM -0500, Sami Imseih wrote:
>>> IMO, in this case, NULL should be a synonym of "I don't know", which
>>> is what entry_count set to false means.  0 means "I know, there is no
>>> data".  I'd be OK with dropping the part about fixed-sized stats where
>>> we enforce 1, and use NULL instead, though.
>>
>> +1, that's also my opinion [1].
>
> I'm ok with that if others feel this is better.

Okay, thanks.  Let's do so then.  Let's also invent a new
pgstat_kind.c in activity/.

I have been chewing a bit on the comments from Sami, leading to the
following result:
- Switched shared_size to entry_size, for consistency with
entry_count, but I don't agree about the use of shared_data_len.
shared_size is more adapted to me because it has the entry overhead
and the shmem entry header.  That's more precise and one does not need
to guess the header size.
- Moved entry_count after entry_size in the list of attributes.
- written_to_file -> write_to_file, same as pgstat_internal.h.
- Moved the new function to a pgstat_kind.c.
- Some extra changes and tweaks to the comments, the docs, some code.

The attached should do all that, hopefully.  Any thoughts?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication
Next
From: Peter Eisentraut
Date:
Subject: Re: vectorized CRC on ARM64