Re: AllocSetEstimateChunkSpace()

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: AllocSetEstimateChunkSpace()
Дата
Msg-id b792193cb19cd348e84a5c5b3267a77a6f32edcc.camel@j-davis.com
обсуждение исходный текст
Ответ на AllocSetEstimateChunkSpace()  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: AllocSetEstimateChunkSpace()  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Tue, 2020-03-24 at 18:12 -0700, Jeff Davis wrote:
> I considered making it a method of a memory context, but the planner
> will call this function before the hash agg memory context is
> created.

I implemented this approach also; attached.

It works a little better by having access to the memory context, so it
knows set->allocChunkLimit. It also allows it  to work with the slab
allocator, which needs the memory context to return a useful number.
However, this introduces more code and awkwardly needs to use
CurrentMemoryContext when called from the planner (because the actual
memory context we're try to estimate for doesn't exist yet).

I slightly favor the previous approach (mentioned in the parent email) 
because it's simple and effective. But I'm fine with this one if
someone thinks it will be better for other use cases.

Regards,
    Jeff Davis


Вложения

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

Предыдущее
От: Anna Akenteva
Дата:
Сообщение: Re: [HACKERS] make async slave to wait for lsn to be replayed
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: [HACKERS] advanced partition matching algorithm forpartition-wise join