| From: | Sami Imseih <samimseih(at)gmail(dot)com> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [Proposal] Adding callback support for custom statistics kinds |
| Date: | 2025-12-04 23:00:10 |
| Message-ID: | CAA5RZ0sJgO6GAwgFxmzg9MVP=rM7Us8KKcWpuqxe-f5qxmpE0g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> If we push down the responsibility into the extension code, then all extensions
> that want to enjoy the callbacks have to handle the same complexities of dealing
> with stat files, which sounds big duplicate efforts.
Thanks for the input! Yes, this is a trade-off between putting
responsibility on the
extension vs core. The initial thought I had was exactly like yours, but it will
be easier to get something pushed if we make the core changes as minimal as
possible. If there are enough complaints in the future, this can be revisited.
Particularly if there is a common patterns for file cleanup, this
could be turned
into a core utility.
> That looks like a good direction to me. The only differences I can
> see with the stats module in injection_points for variable-sized stats
> is that this new module does not check pgstat_drop_entry() and
> pgstat_fetch_entry() when working on a custom stats kind. If we had
> SQL interfaces calling these two, we could just remove
> injection_stats.c entirely, moving everything to this new test module.
> I should have invented a new module from the start, perhaps, but well,
> that was good enough to check the basic APIs when working on the
> custom APIs. Removing this duplication would be my own business with
> your module in the tree, no need for you to worry about that. That
> would also remove the tweak you have used regarding the duplicated
> kind ID.
I plan on addressing the other comments.
However, as discussed off-list, I do think moving the custom kind tests from
injection points to the new test module is a prerequisite. I rather
not have us
push a new test module that is doing duplicate work as the injection
stats tests.
I worked on this refactoring today and plan to have a patch ready for review
by tomorrow.
--
Sami Imseih
Amazon Web Services (AWS)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Paul A Jungwirth | 2025-12-04 23:11:36 | Clarify temporal FK comments |
| Previous Message | Thomas Munro | 2025-12-04 22:52:35 | Re: More const-marking cleanup |