Re: Odd out of memory problem.

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Odd out of memory problem.
Дата
Msg-id CAM-w4HP0XGb+SWJR4gKPYDUGPf5uDFq85RORiq6tf7ttkJB+ig@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Odd out of memory problem.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Odd out of memory problem.
Список pgsql-hackers
On Mon, Mar 26, 2012 at 5:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Hm.  This illustrates that it's not too prudent to rely on a default
> numdistinct estimate to decide that a hash aggregation is safe :-(.
> We had probably better tweak the cost estimation rules to not trust
> that.  Maybe, if we have a default estimate, we should take the worst
> case estimate that the column might be unique?  That could still burn
> us if the rowcount estimate was horribly wrong, but those are not nearly
> as shaky as numdistinct estimates ...

Perhaps we should have two work_mem settings -- one for the target to
aim for and one for a hard(er) limit that we should ensure the worst
case falls under?

I have a sketch for how to handle spilling hash aggregates to disk in
my head. I'm not sure if it's worth the amount of complexity it would
require but I'll poke around a bit and see if it works out well.

--
greg


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Odd out of memory problem.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Odd out of memory problem.