Re: Add support for entry counting in pgstats

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Keisuke Kuroda <keisuke.kuroda.3862@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-09-25T00:38:55Z
Lists: pgsql-hackers

Attachments

On Wed, Sep 24, 2025 at 11:37:25AM +0900, Keisuke Kuroda wrote:
> Regarding the option name track_counts in PgStat_KindInfo.
> In my personal opinion, I was just wondering that it shares
> the same name as the GUC track_counts(pgstat_track_counts in the source code).
> If we want to make it clearer, renaming it to track_entry_counts
> could be one option.

Yes, that's a good point and I have missed the GUC part.  What you are
suggesting is cleaner overall with the flag added to the pgstats kind
info.

> (That said, I feel the GUC track_counts option has a mismatch
> between its role and its name...)

I doubt that we will rename this GUC at any point in the future.

Updated patch attached with the new name, as you are suggesting.
--
Michael

Commits

  1. injection_points: Enable entry count in its variable-sized stats

  2. Add support for tracking of entry count in pgstats

  3. Keep track of what RTIs a Result node is scanning.