Re: Creating a function for exposing memory usage of backend process
torikoshia <torikoshia@oss.nttdata.com>
From: torikoshia <torikoshia@oss.nttdata.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: pgsql-hackers@postgresql.org
Date: 2020-07-06T03:12:18Z
Lists: pgsql-hackers
Attachments
- 0004-Adding-a-function-exposing-memory-usage-of-local-backend.patch (text/x-diff) patch 0004
On Fri, Jul 3, 2020 at 7:33 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote: Thanks for your review! > I like more specific name like pg_backend_memory_contexts. Agreed. When I was trying to add this function as statistics function, I thought that naming pg_stat_getbackend_memory_context() might make people regarded it as a "per-backend statistics function", whose parameter is backend ID number. So I removed "backend", but now there is no necessity to do so. > But I'd like to hear more opinions about the name from others. I changed the name to pg_backend_memory_contexts for the time being. >> - function name: pg_get_memory_contexts() >> - source file: mainly src/backend/utils/mmgr/mcxt.c >> + Identification information of the memory context. This field >> is truncated if the identification field is longer than 1024 >> characters > > "characters" should be "bytes"? Fixed, but I used "characters" while referring to the descriptions on the manual of pg_stat_activity.query below. | By default the query text is truncated at 1024 characters; It has nothing to do with this thread, but considering multibyte characters, it also may be better to change it to "bytes". Regarding the other comments, I revised the patch as you pointed. Regards, -- Atsushi Torikoshi NTT DATA CORPORATION
Commits
-
Add regression test for pg_backend_memory_contexts.
- adc8fc6167aa 14.0 landed
-
Move codes for pg_backend_memory_contexts from mmgr/mcxt.c to adt/mcxtfuncs.c.
- 50db5964ee33 14.0 landed
-
Prevent non-superusers from reading pg_backend_memory_contexts, by default.
- 29dd6d8bc631 14.0 landed
-
Add pg_backend_memory_contexts system view.
- 3e98c0bafb28 14.0 landed
-
Fix yet another issue with step generation in partition pruning.
- 199cec977950 14.0 cited