Re: Multicolumn Indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Multicolumn Indexes
Дата
Msg-id 11530.1097863054@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Multicolumn Indexes  ("Thomas Yagel" <tyagel@yahoo.com>)
Список pgsql-general
"Thomas Yagel" <tyagel@yahoo.com> writes:
> Right now the index that I have on timestamp is not used because the Primary
> Key(ID) index is chosen for ordering.  If I place a multicolumn index on
> (timestamp, id) will that index be able to filter the timestamp and still be
> used for returning the ordered IDs?

You'd need to do that and also say "ORDER BY timestamp, id" not just
"ORDER BY id".

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Changing session ownership in a web app (or how to peel an onion)
Следующее
От: snpe
Дата:
Сообщение: pgsql cvs