Re: Backwards index scan

Поиск
Список
Период
Сортировка
От Alan Hodgson
Тема Re: Backwards index scan
Дата
Msg-id 200606060804.45516@hal.medialogik.com
обсуждение исходный текст
Ответ на Backwards index scan  ("Carlos Oliva" <carlos@pbsinet.com>)
Ответы Re: Backwards index scan  ("Carlos Oliva" <carlos@pbsinet.com>)
Список pgsql-general
On June 6, 2006 07:59 am, "Carlos Oliva" <carlos@pbsinet.com> wrote:
> We are conducting a simple test to asses if the optimizer ever uses the
> index.  The table has several columns and the select statement is as
> follows: select * from ord0007 order by prtnbr, ordschdte desc.  The
> index that we added is "ord0007_k" btree (prtnbr, ordschdte).  Prtnbr is
> numeric(10,0) not null, and ordschdte is date.

You have to "order by prtnbr desc, ordschdte desc" to have the index used
the way you want.  You can re-order in an outer query if you need to.

--
Alan

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

Предыдущее
От: "Carlos Oliva"
Дата:
Сообщение: Backwards index scan
Следующее
От: Rafal Pietrak
Дата:
Сообщение: Re: ALTER USER ..... PASSWORD ....