Re: Order by and index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Order by and index
Дата
Msg-id 18676.1128523806@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Order by and index  (Jonathan Tse <dev@tsez.net>)
Ответы Re: Order by and index  (Jonathan Tse <dev@tsez.net>)
Список pgsql-novice
Jonathan Tse <dev@tsez.net> writes:
>     It is good. However, if I execute the following query:

>     select * from t_post where ownerid = 2
>     order by t_stamp

>     The query planner doesn't use the index for sorting.

Try "order by ownerid, t_stamp".

Postgres 8.1 will recognize that the where clause makes it OK to
consider the ORDER BY as matching the index order, but existing
releases do not know that.

            regards, tom lane

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

Предыдущее
От: "Daniel T. Staal"
Дата:
Сообщение: Re: Missing file LIBC06P1
Следующее
От:
Дата:
Сообщение: Re: Moving from MySQL