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-03T02:45:52Z
Lists: pgsql-hackers
Attachments
- 0003-Adding-a-function-exposing-memory-usage-of-local-backend.patch (text/x-diff) patch 0003
On Wed, Jul 1, 2020 at 10:15 PM torikoshia <torikoshia@oss.nttdata.com> wrote: > I'm going to do some renaming and transportations. > > - view name: pg_memory_contexts > - function name: pg_get_memory_contexts() > - source file: mainly src/backend/utils/mmgr/mcxt.c Attached an updated patch. On Wed, Jul 1, 2020 at 10:58 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote: > Ok, understood! I agree that it's strange to display different names > for the same memory context between this view and logging. > > It's helpful if the comment there refers to MemoryContextStatsPrint() > and mentions the reason that you told. Agreed. I changed the comments. > > It also derived from MemoryContextStatsPrint(). > > I suppose it is for keeping readability of the log.. > > Understood. I may want to change the upper limit of query size to > display. > But at the first step, I'm fine with limitting 1024 bytes. Thanks, I've left it as it was. > > I'm going to follow the discussion on the mailing list and find why > > these codes were introduced. > > https://www.postgresql.org/message-id/12319.1521999065%40sss.pgh.pa.us Thanks for sharing! 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