Re: Change the signature of pgstat_report_vacuum() so that it's passed a Relation

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Change the signature of pgstat_report_vacuum() so that it's passed a Relation
Date: 2025-12-16 07:39:05
Message-ID: aUEMmcPV1E3A0fDr@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 16, 2025 at 06:49:13AM +0000, Bertrand Drouvot wrote:
> While working on relfilenode statistics, Andres suggested that we pass the Relation
> to pgstat_report_vacuum() (instead of the parameters inherited from the Relation,
> (See [1])).
>
> That looks like a good idea to me as it reduces the number of parameters and it's
> consistent with pgstat_report_analyze().

Fine by me. I can get behind the symmetry argument with
pgstat_report_analyze() for pgstat_report_vacuum(). Another
appoealing argument with this change is that it forces the callers of
pgstat_report_vacuum() to open a relation, enforcing the policy that
we need a lock of them before reporting stats. I don't think that we
will ever have dozens of callers of pgstat_report_vacuum() in the
tree, but it makes the API contract cleaner IMO with a long-term
picture in mind.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-12-16 07:46:56 Re: Fix crash during recovery when redo segment is missing
Previous Message Michael Paquier 2025-12-16 07:33:17 Re: relfilenode statistics