| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> |
| Cc: | samimseih(at)gmail(dot)com, lukas(at)fittl(dot)com, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Improve pg_stat_statements scalability |
| Date: | 2026-06-04 04:50:59 |
| Message-ID: | aiEEM-61KuVBSvxY@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Jun 03, 2026 at 05:10:39PM +0900, Kyotaro Horiguchi wrote:
> One alternative would be to introduce a separate callback for anytime
> flushes. However, since transaction-boundary flushes ultimately need
> to flush everything anyway, it seems to me that passing a context flag
> would be sufficient.
Nah. I am not really in favor of an extra callback. I feel that this
could lead to more mistakes when implementing new stats kinds, so
doing your approach of using a value based on the context of the flush
works for me.
> I tend to agree with the single-entry-point approach.
>
> The basic operation is common; the anytime case differs only in the
> context in which the flush is requested. The flush-timing logic in
> pgstat_report_stat() may become slightly more complicated with anytime
> flushes, but after that point I think the existing path should
> continue to work with only minor adjustments, by carrying an explicit
> context value down to the callbacks.
Yeah, same feeling here. That would be the way I'd use to approach
this design, and to aim for one single entry point for all the stats
reports and the flushes, for all the contexts.
--
Michael
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | Michael Paquier | 2026-06-04 04:47:32 | Re: SERVICEFILE shows wrong file after servicefile fallback |