Re: wip: functions median and percentile

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: wip: functions median and percentile
Дата
Msg-id AANLkTi=D66fO75S2meJNtXz9z81EWW-CJmqh-6Q-8Sob@mail.gmail.com
обсуждение исходный текст
Ответ на 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
On Mon, Oct 4, 2010 at 2:58 AM, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> That requires a new sort for each row. I generated this with a minor
> tweak to Pavel's patch to just restart the tuplesort each time (the
> "quick-fix" solution). The problem is that performance really sucks,
> because it is an O(n^2 log(n)) algorithm.

Maybe that's OK.  If you're doing repeated median operations on large
data sets, perhaps you should expect that to be slow.  I bet that
people who want to use this as a window function will want one median
per group, not n medians per group; and it doesn't seem like a good
idea to say - we're not going to let you use this as a window function
AT ALL because you might decide to do something that will be really
slow.  You can always hit ^C if you get tired of waiting.  This seems
like it's very far from being the most important thing for us to
optimize, though of course it's great if we can.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pgadmin3_90 package
Следующее
От: Robert Haas
Дата:
Сообщение: Re: ALTER DATABASE RENAME with HS/SR