Re: wip: functions median and percentile

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: wip: functions median and percentile
Дата
Msg-id 24543.1286811848@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: wip: functions median and percentile  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: wip: functions median and percentile  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On 11 October 2010 15:03, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Reflecting on it, I think it'd be best to allow an agg to
>> provide an estimation function that'd be told the input data type and
>> expected number of rows --- even on a per-aggregate basis, a constant
>> estimate just isn't good enough.

> How good will that estimate of the number of rows be though?

It can't possibly be any worse than a hard-wired constant ;-)

> If they're coming from a SRF it could be a huge under-estimate, and you'd
> still risk eating all the memory, if you allowed a hash aggregate.

If, for a particular aggregate, you're too chicken to ever allow hash
aggregation, you could just return a very large number from the
estimation hook function.  I doubt that's a very useful behavior in the
majority of cases though.
        regards, tom lane


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

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: wip: functions median and percentile
Следующее
От: Tom Lane
Дата:
Сообщение: Re: On the usefulness of hint bits