TODO items for window functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: TODO items for window functions
Date: 2008-12-28 19:26:01
Message-ID: 357.1230492361@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The core window-functions patch is now committed and ready for wider
testing. However, there are a number of unfinished items, at least
some of which I'd like to see addressed before 8.4 release. In rough
order of importance:

* Support creation of user-defined window functions. I think this is
a "must have" for 8.4 --- we are not in the habit of building
nonextensible basic features. It doesn't seem that hard either.
I think all we need do is to allow "WINDOW" as an attribute keyword
in CREATE FUNCTION. Does anyone have an objection or a better idea?

* Implement support for non-default window framing clauses. Most likely
it's too late to consider getting the whole feature done for 8.4, but
I wonder whether we could support the restricted case of allowing just
these two combinations
BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW (which is default)
BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
I said earlier that we didn't really need to address this for 8.4,
but my thinking was flawed. The case I think is really important
is to allow last_value() to do something useful, and you can hardly
argue that it's useful without an ORDER BY to define which row in the
partition is "last".

* Investigate whether we should prohibit window functions in recursive
terms; check whether any of the committed prohibitions are unnecessary.

* Look at tuplestore performance issues. The tuplestore_in_memory()
thing is just a band-aid, we ought to try to solve it properly.
tuplestore_advance seems like a weak spot as well.

* Do we really need so much duplicated code between Agg and WindowAgg?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-12-28 20:21:16 ecpg regression test failures caused by window functions patch
Previous Message Tom Lane 2008-12-28 18:58:16 Re: Windowing Function Patch Review -> Standard Conformance