Re: Reducing System Allocator Thrashing of ExecutorState to Alleviate FDW-related Performance Degradations

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Reducing System Allocator Thrashing of ExecutorState to Alleviate FDW-related Performance Degradations
Дата
Msg-id 20230220194648.6srifjiihto5vhho@awork3.anarazel.de
обсуждение исходный текст
Ответ на Re: Reducing System Allocator Thrashing of ExecutorState to Alleviate FDW-related Performance Degradations  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Reducing System Allocator Thrashing of ExecutorState to Alleviate FDW-related Performance Degradations
Список pgsql-hackers
Hi,


On 2023-02-21 08:33:22 +1300, David Rowley wrote:
> On Tue, 21 Feb 2023 at 07:30, Andres Freund <andres@anarazel.de> wrote:
> > 2) We should introduce an API mcxt.c API to perform allocations that the
> >    caller promises not to individually free.
> 
> It's not just pfree. Offhand, there's also repalloc,
> GetMemoryChunkSpace and GetMemoryChunkContext too.

Sure, and all of those should assert out / crash if done with the allocation
function.


> I am interested in a bump allocator for tuplesort.c. There it would be
> used in isolation and all the code which would touch pointers
> allocated by the bump allocator would be self-contained to the
> tuplesorting code.
> 
> What use case do you have in mind?

E.g. the whole executor state tree (and likely also the plan tree) should be
allocated that way. They're never individually freed. But we also allocate
other things in the same context, and those do need to be individually
freeable. We could use a separate memory context, but that'd increase memory
usage in many cases, because there'd be two different blocks being allocated
from at the same time.

To me opting into this on a per-allocation basis seems likely to make this
more widely usable than requiring a distinct memory context type.

Greetings,

Andres Freund



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: meson: Non-feature feature options
Следующее
От: Andres Freund
Дата:
Сообщение: Re: meson: Optionally disable installation of test modules