Re: Underspecified window queries in regression tests

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема Re: Underspecified window queries in regression tests
Дата
Msg-id CAP7Qgm=87FA0f=ECvUYP3zF+zth+nvnsxGxMxvGnSgQVnGURZA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Underspecified window queries in regression tests  (Greg Stark <stark@mit.edu>)
Список pgsql-hackers
2011/10/17 Greg Stark <stark@mit.edu>:
> On Fri, Oct 14, 2011 at 9:32 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> We could hack around this by adding more columns to the result so that
>> an index-only scan doesn't work.  But I wonder whether it wouldn't be
>> smarter to add ORDER BY clauses to the window function calls.  I've been
>> known to argue against adding just-in-case ORDER BYs to the regression
>> tests in the past; but these cases bother me more because a plan change
>> will not just rearrange the result rows but change their contents,
>> making it really difficult to verify that nothing's seriously wrong.
>
> I'm not sure if it applies to this case but I recall I was recently
> running queries on Oracle that included window functions and it
> wouldn't even let me run them without ORDER BY clauses in the window
> definition. I don't know if it cleverly determines that the ORDER BY
> will change the results or if Oracle just requires ORDER BY on all
> window definitions or what.

AFAIK, the current standard doesn't tell clearly if all/some window
functions require ORDER BY clause in window specifications. Some
window functions like rank and row_number is meaningless if it is
omitted, so some implementation doesn't allow it omitted. And I
believe Oracle implemented it before the standard, so that'd be why
details are different from spec. We designed it per spec and omitting
the clause doesn't violate any part of the standard.

Regards,
--
Hitoshi Harada


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

Предыдущее
От: Kerem Kat
Дата:
Сообщение: Re: Adding CORRESPONDING to Set Operations
Следующее
От: Robert Haas
Дата:
Сообщение: Re: proposal: set GUC variables for single query