Re: Bypassing useless ORDER BY in a VIEW

Поиск
Список
Период
Сортировка
От Dean Gibson (DB Administrator)
Тема Re: Bypassing useless ORDER BY in a VIEW
Дата
Msg-id 47C6F8EE.1080409@ultimeth.com
обсуждение исходный текст
Ответ на Re: Bypassing useless ORDER BY in a VIEW  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Bypassing useless ORDER BY in a VIEW  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On 2008-02-28 09:13, Tom Lane wrote:
> A rule of thumb is that ORDER BY in a view is bad design, IMHO.
>
>             regards, tom lane
>

I was surprised to find out that apparently it's also a PostgreSQL
extension;  standard SQL apparently disallows ORDER BY in VIEWs:

http://en.wikipedia.org/wiki/Order_by_(SQL)

When I found this out, I removed all the ORDER BYs from my VIEWs (which
had been there for the convenience of subsequent SELECTs).

Of course, where ORDER BY in a VIEW is really helpful, is with OFFSET
and/or LIMIT clauses (which are also PostgreSQL extensions), which is
equivalent to what you point out.

--
Mail to my list address MUST be sent via the mailing list.
All other mail to my list address will bounce.


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

Предыдущее
От: "Laurent Raufaste"
Дата:
Сообщение: Re: PG planning randomly ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bypassing useless ORDER BY in a VIEW