Re: Window functions patch v04 for the September commit fest

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема Re: Window functions patch v04 for the September commit fest
Дата
Msg-id e08cc0400809020136o69c4713fyd020d440d971ea19@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Window functions patch v04 for the September commit fest  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
2008/9/2 Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>:
> Gregory Stark wrote:
>> What would the executor do for a query like
>>
>> SELECT lead(x,1),lead(y,2),lead(y,3)
>>
>> It would not only have to keep a tuplestore to buffer the output but it
>> would
>> have to deal with receiving data from different SRFs at different times.
>> The
>> best approach I can think of would be to keep a tuplestore for each SRF
>> using
>> themas queues, reading old values from the head as soon as they all have
>> at
>> least one new value in them.
>
> Hitoshi solved that creating a separate Window node for each window
> function. So the plan tree for that would look something like:
>
> Window (lead(x,1))
>  Window (lead(y,2))
>    Window (lead(y,3))
>      Seq Scan ...
>
> That keeps the Window node implementation quite simple because it only needs
> to handle one window function at a time.

To say more accurately, one Window node can handle more than one
window function. If it is thought to be the same using equalFuncs
comparing targetlists, some functions are put into one node.

Regards,


-- 
Hitoshi Harada


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

Предыдущее
От: Stefan Kaltenbrunner
Дата:
Сообщение: Re: Window functions patch v04 for the September commit fest
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Window functions patch v04 for the September commit fest