Re: Window Functions: buffering strategy - Mailing list pgsql-hackers

From Hitoshi Harada
Subject Re: Window Functions: buffering strategy
Date
Msg-id e08cc0400810202035s44e5f005q6240aa8f3c126217@mail.gmail.com
Whole thread Raw
In response to Re: Window Functions: buffering strategy  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
2008/10/21 Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>:
> Hitoshi Harada wrote:
>>
>> The real problem is not how to cut off preceding rows, but how to read
>> ahead after the current row. I intend to avoid reading ahead until end
>> of the partition for only row_number() that doesn't need any following
>> rows. Sometimes we have to store whole the partition before returning
>> the first result and sometimes not. It depends on function categories,
>> or function access range. My current idea is classify Window function
>> API to three parallel to buffering strategies.
>
> Could the rows be read ahead on demand? If the window function calls
> window_getarg on a row that's not yet fetched, fetch forward to that row.

Well, it could be possible. But from my current view it will be very
complicated and might be impossible. So I will try to implement basic
approach, and let's consider your approach then. We keep stay in
private API so that we have time to consider again.

Regards,


-- 
Hitoshi Harada


pgsql-hackers by date:

Previous
From: Paul Schlie
Date:
Subject: Re: Block-level CRC checks
Next
From: ITAGAKI Takahiro
Date:
Subject: pg_stat_statements in core