Re: Add pg_stat_kind_info system view

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Tristan Partin <tristan(at)partin(dot)io>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add pg_stat_kind_info system view
Date: 2026-07-01 07:07:06
Message-ID: akS8mpyTBLp7q0w3@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
v3-0001-Add-pg_stat_kind_info-view.patch text/plain 16.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-07-01 07:07:35 Re: vectorized CRC on ARM64
Previous Message shveta malik 2026-07-01 06:34:25 Re: Proposal: Conflict log history table for Logical Replication