Re: BUG #5608: array_agg() consumes too much memory
От
Tom Lane
Тема
Re: BUG #5608: array_agg() consumes too much memory
Дата
Msg-id
20060.1281410188@sss.pgh.pa.us
Ответ на
BUG #5608: array_agg() consumes too much memory (Itagaki Takahiro)
Список
Дерево обсуждения
BUG #5608: array_agg() consumes too much memory "Itagaki Takahiro" <itagaki.takahiro@gmail.com>
Re: BUG #5608: array_agg() consumes too much memory Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #5608: array_agg() consumes too much memory Itagaki Takahiro <itagaki.takahiro@gmail.com>
Re: BUG #5608: array_agg() consumes too much memory Hitoshi Harada <umi.tanuki@gmail.com>
Re: BUG #5608: array_agg() consumes too much memory Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #5608: array_agg() consumes too much memory Tom Lane <tgl@sss.pgh.pa.us>
"Itagaki Takahiro" writes: > I encountered "out of memory" error in large > GROUP BY query with array_agg(). The server log > was filled by the following messages: > accumArrayResult: 8192 total in 1 blocks; 7800 free (0 chunks); 392 > used > Should we choose smaller size of initial memory in accumArrayResult()? That's not really going to help much, considering that the planner's estimated memory use per hash aggregate is only a few dozen bytes. We have to get that estimate in sync with reality or the problem will remain. Eventually it might be nice to have some sort of way to specify the estimate to use for any aggregate function --- but for a near-term fix maybe we should just hard-wire a special case for array_agg in count_agg_clauses_walker(). I'd be inclined to leave the array_agg code as-is and teach the planner to assume ALLOCSET_DEFAULT_INITSIZE per array_agg aggregate. regards, tom lane
В списке pgsql-bugs по дате отправления
От: Robert Haas
Дата: