Re: Add pg_stat_kind_info system view

solai v <solai.cdac@gmail.com>

From: solai v <solai.cdac@gmail.com>
To: Tristan Partin <tristan@partin.io>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Michael Paquier <michael@paquier.xyz>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: 2026-06-11T06:35:01Z
Lists: pgsql-hackers
Hi all,

On Wed, Jun 10, 2026 at 3:34 PM Tristan Partin <tristan@partin.io> wrote:
>
> Of course I forgot to attach the patch :D.
>
> --


I reviewed the v1 patch and had verified that both the view and the
function are created successfully and return identical results. The
builtin statistics kinds are exposed correctly, and the IDs and names
are unique without any duplicates. The count column behaves as
expected, returning NULL for statistics kinds that do not support
entry count tracking and 1 for fixed statistics kinds. While reviewing
the patch, I found it may be useful to expose a boolean column such as
track_entry_count in pg_stat_kind_info that would explicitly indicate
whether entry count tracking is enabled for a statistics kind and also
would help users understand why the count column is NULL for certain
statistics kinds. Exposing this internal property would make the view
more self-explanatory and improve its usefulness for debugging. Apart
from these suggestions, I did not find any issues with the current
implementation.
Looking forward to more feedback.


Regards,
Solai



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add system view pg_stat_kind_info

  2. Introduce pluggable APIs for Cumulative Statistics