Re: [HACKERS] pg_shmem_allocations view

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] pg_shmem_allocations view
Дата
Msg-id CA+TgmoazhJnk25jKPXtRPxNddM8ZxDdJ7-OP5wiWSBsXJ2AWBg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] pg_shmem_allocations view  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] pg_shmem_allocations view  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
On Wed, Dec 18, 2019 at 12:06 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> It seems like it'd be worth subdividing "<anonymous>" into the actual
> anonymous allocations and the allocator overhead (which is both
> padding and whatever the shmem allocator itself eats).  Maybe call
> the latter "<overhead>".  After which, I'd be tempted to call the
> free space "<free>" rather than giving it a null name.

Here's a new version that takes a slightly different approach: it adds
an additional column to the view for "allocated_size," so that you can
see both what was requested and what you actually got.  With this
approach, you can do interesting things like:

select *, off - lag(off + allocated_size, 1) over () as hole_size from
(select * from pg_shmem_allocations order by 2) x;

...which didn't work very well with the previous version.

All of this makes me think that we might want to do some followup to
(1) convert anonymous allocations to non-anonymous allocations, for
inspectability, and (2) do some renaming to get better stylistic
agreement between the names of various shared memory chunks. But I
think that work is properly done after this patch is committed, not
before.

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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: gmail Vladimir Koković
Дата:
Сообщение: Restore backup file "with oids"
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Read Uncommitted