Re: Add pg_stat_kind_info system view

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Sami Imseih <samimseih(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 03:39:37
Message-ID: akSL+UwLQIAj2QPf@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Jul 01, 2026 at 10:35:33AM +0900, Michael Paquier wrote:
> On Tue, Jun 30, 2026 at 05:36:57PM -0500, Sami Imseih wrote:
> > + <structfield>count</structfield> <type>bigint</type>
> > + </para>
> > + <para>
> > + Number of tracked entries for this kind. For fixed-amount
> > kinds, this is
> > + always 1. For variable-numbered kinds, this is the number of objects
> > + currently tracked. <literal>NULL</literal> if the kind does not track
> > + entry counts.
> > + </para>
> > + </entry>
> >
> > I think this should be 0 for all kinds by default. Only ever > 0 for
> > variable-numbered
> > kinds with entry tracking enabled. No NULLs. The fields should be called
> > "entry_count" instead of "count". We should update the documentation to
> > reflect that as well. That seems easier to query than having mixed NULLs and
> > numbers.
>
> 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].

[1]: https://postgr.es/m/ajtroNXfBS/ldtNZ%40bdtpg

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2026-07-01 04:01:04 Re: Update EnableTimeoutParams timeout type comment
Previous Message Haibo Yan 2026-07-01 03:26:51 Re: [PATCH v2] Avoid internal error for invalid interval typmods