Re: R: R: complex custom aggregate function

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: R: R: complex custom aggregate function
Дата
Msg-id 4136ffa0902020719o5b742d4x329acce529f5164d@mail.gmail.com
обсуждение исходный текст
Ответ на Re: R: R: complex custom aggregate function  (Scara Maccai <m_lists@yahoo.it>)
Список pgsql-general
On Mon, Feb 2, 2009 at 2:30 PM, Scara Maccai <m_lists@yahoo.it> wrote:
> Paolo Saudin wrote:
>> I use a master table with a "fulldate" field and filled with sequential dates to
>> fill gaps when meteo data is missing.
>
> I'm sorry, I still don't get it: how can you be sure that postgresql won't call perl_sliding_mean with not-ordered
timestamps-data?I don't mean only in case of holes. 
>
> The "order by" as far as I know is usually done at the very end of the plan, so I don't think it can affect the order
ofthe data passed to the function... 


You need to make a subquery with the ORDER BY on it. Postgres won't
re-order an ORDER BY in a subquery to happen outside the outer query.

So something like

select perl_function(foo) from (select foo from table order by bar)

--
greg

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

Предыдущее
От: Mohamed
Дата:
Сообщение: Re: Fulltext search configuration
Следующее
От: "Scot Kreienkamp"
Дата:
Сообщение: Re: Warm Standby question