Re: order by not working in view ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: order by not working in view ?
Дата
Msg-id 5555.1586443297@sss.pgh.pa.us
обсуждение исходный текст
Ответ на order by not working in view ?  (David Gauthier <davegauthierpg@gmail.com>)
Список pgsql-general
David Gauthier <davegauthierpg@gmail.com> writes:
> In the copy/paste below, first 2 lines returned by a select on the view,
> why didn't it sort on start_datetime correctly ?

Putting an ORDER BY in a view is a bit dangerous (last I looked,
it wasn't even legal in standard SQL).  Yeah, the view will sort,
but there is nothing compelling the calling query to preserve
the ordering.

EXPLAIN would give you more info, but I'm betting that the IN is being
converted to a semijoin and then done with a non-order-preserving join
method.

            regards, tom lane



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: full text
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: order by not working in view ?