Re: wip: functions median and percentile

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: wip: functions median and percentile
Дата
Msg-id AANLkTimLRqYaSgbrEs2RoOJe2t-b8hP59vn0Ap8Mn5MT@mail.gmail.com
обсуждение исходный текст
Ответ на Re: wip: functions median and percentile  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 11 October 2010 19:05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dean Rasheed <dean.a.rasheed@gmail.com> writes:
>> On 11 October 2010 18:48, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> And?  If the memory requirement actually fits, you're in good shape.
>
>> Yeah but the actual memory requirement, if it uses a hash aggregate,
>> is over 1GB, and could easily be much higher.
>
> In that case the estimate of 30K per instance was wrong.
> You still haven't explained why this is impossible to estimate,
> or even particularly hard, as long as we can provide some code that
> knows specifically about the behavior of this aggregate.  The amount
> of space needed to sort X amount of data is not unpredictable.
>

The estimate that's wrong is the number of rows that the SRF is going
to return. If I'm reading the plan right, the planner thinks that the
aggregate is going to be called 200 times on groups of 5 rows.
Actually, it's called 40000 times on groups of 1 row.

Regards,
Dean


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Which file does the SELECT?
Следующее
От: Greg Stark
Дата:
Сообщение: Re: wip: functions median and percentile