Re: PATCH: decreasing memory needlessly consumed by array_agg

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: PATCH: decreasing memory needlessly consumed by array_agg
Дата
Msg-id 533B14DA.9030907@fuzzy.cz
обсуждение исходный текст
Ответ на Re: PATCH: decreasing memory needlessly consumed by array_agg  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 1.4.2014 20:56, Tom Lane wrote:
> Tomas Vondra <tv@fuzzy.cz> writes:
>> On 1.4.2014 19:08, Tom Lane wrote:
> You're conveniently ignoring the callers that set release=true.
> Reverse engineering a query that exhibits memory bloat is left
> as an exercise for the reader (but in a quick look, I'll bet
> ARRAY_SUBLINK subplans are one locus for problems).

No, I'm not. I explicitly mentioned those cases (although you're right I
concentrated mostly on cases with release=false, because of array_agg).

> It's possible that it'd work to use a subcontext only if
> release=true; I've not dug through the code enough to convince myself
> of that.

Maybe, though 'release' is not available in makeArrayResult() which is
where the memory context needs to be decided. So all the callers would
need to be modified to supply this parameter. But there only ~15 places
where makeArrayResult is called.

regards
Tomas



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PATCH: decreasing memory needlessly consumed by array_agg
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: json/jsonb/hstore operator precedence