Re: Use generation context to speed up tuplesorts

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Use generation context to speed up tuplesorts
Дата
Msg-id CAApHDvqUY3Nb-Yfcd0A4GRX7ce-YL3rOm4emH-hFwpmmDjVf0w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Use generation context to speed up tuplesorts  (Andres Freund <andres@anarazel.de>)
Ответы Re: Use generation context to speed up tuplesorts  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Sat, 31 Jul 2021 at 08:38, Andres Freund <andres@anarazel.de> wrote:
> There is at least one path using tuplecontext that reaches code that
> could end up freeing memory to a significant enough degree to care about
> generation.c effectively not using that memory:
> tuplesort_putdatum()->datumCopy()->EOH_flatten_into()
> On a quick look I didn't find any expanded record user that frees
> nontrivial amounts of memory, but I didn't look all that carefully.

I guess we could just use a normal context for datum sorts if we
thought that might be a problem.

I'm not too familiar with the expanded object code, but I'm struggling
to imagine why anything would need to do a pfree in there. We just do
EOH_get_flat_size() to determine how big to make the allocation then
allocate some memory for EOH_flatten_into() to use to expand the
object into.

David



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

Предыдущее
От: "Bossart, Nathan"
Дата:
Сообщение: Re: make MaxBackends available in _PG_init
Следующее
От: Mike Klaas
Дата:
Сообщение: Re: disfavoring unparameterized nested loops