Re: pg_shmem_allocations view

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_shmem_allocations view
Date: 2014-05-06 19:37:04
Message-ID: CA+TgmoZQq4ppNC-oA4oiBq7zJ_m5ZyiF4rFY6XXQqrCjQaoJYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 6, 2014 at 2:34 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
>> Attached are two patches:
>> a) Patch addin a 'name' parameter to dsm_create(). I think we should
>> apply this to 9.4.
>> b) pg_dynamic_shmem_allocations and pg_static_shmem_allocations
>> views. The previous version didn't include dsm support and didn't
>> take the required lock.
>
>> I am not so sure whether b) should be applied together with a) in 9.4,
>> but I'd be happy enough to add docs if people agree with the naming.
>
> FWIW, I vote for fixing (a) now but holding (b) for 9.5.

I guess I'll vote for applying both. I don't see a lot of risk, and I
think doing one with out the other is somewhat pointless.

Regarding patch 0002, I don't think we're using the term "static
shmem" anywhere else, so I vote for dropping the word static, so that
we have pg_get_shmem_allocations() and
pg_get_dynamic_shmem_allocations(). Also, I think using the
"allocated" column is pretty weird. There are always exactly two
entries with allocated = false, one of which is for actual free memory
and the other of which is for memory that actually IS allocated but
without using ShmemIndex (maybe the latter was supposed to have
allocated = true but still key = null?). I guess I'd vote for
ditching the allocated column completely and outputting the memory
allocated without ShmemIndex using some fixed tag (like "ShmemIndex"
or "Bootstrap" or "Overhead" or something).

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2014-05-06 19:38:41 Re: [COMMITTERS] pgsql: pgindent run for 9.4
Previous Message Heikki Linnakangas 2014-05-06 19:30:15 Wanted: jsonb on-disk representation documentation