Re: Frames vs partitions: is SQL2008 completely insane?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David Rowley" <dgrowley(at)gmail(dot)com>
Cc: "'Hitoshi Harada'" <umi(dot)tanuki(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Frames vs partitions: is SQL2008 completely insane?
Date: 2008-12-27 23:31:11
Message-ID: 3208.1230420671@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David Rowley" <dgrowley(at)gmail(dot)com> writes:
> Hitoshi Harada wrote:
>> I tested on Oracle 10.2.0, and the results are:
>> ...
>> which means the section 4.15 is true. Could anyone try DB2?

> DB2 9.5 results [ are the same ]

OK, good, that means the reference to the frame in 6.10 rule 1b is just
a copy-and-pasteo. (I wonder if it got fixed in the final spec?)
I guess this makes sense because we also see that 6.10 syntax rule 6b
forbids a framing spec on lead/lag, which makes sense if these functions
ignore the frame and no sense otherwise.

I also realized after more thought that the way to get frame = partition
with a default frame spec is to omit any ORDER BY in the window spec.
So my concern about LAST_VALUE being useless without framing ability is
unfounded, and I withdraw the complaint that we need to put in some
minimal framing features. But we'll have to be careful to document all
this properly. Also, it does seem that it might be worthwhile to try to
ensure that combinations of windows that have the same PARTITION list
and empty vs nonempty ORDER BY get optimized well. Right now it's
dependent on ordering of the WindowClause whether you pay an extra sort
for that case or not.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-12-27 23:42:10 Re: Windowing Function Patch Review -> Standard Conformance
Previous Message David Rowley 2008-12-27 22:54:40 Re: Frames vs partitions: is SQL2008 completely insane?