Re: Postgres does not use indexes with OR-conditions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Postgres does not use indexes with OR-conditions
Дата
Msg-id 3340.1415373108@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Postgres does not use indexes with OR-conditions  (Kevin Grittner <kgrittn@ymail.com>)
Список pgsql-performance
Kevin Grittner <kgrittn@ymail.com> writes:
> On the other hand, why not simply write it as?:

> select *
>   from commons.financial_documents fd
>   where (fd.creation_time, fd.financial_document_id)
>       < ('2011-11-07 10:39:07.285022+08', 100)
>   order by fd.creation_time desc
>   limit 200

That's the way to do it, not only because it's simpler and clearer,
but because the planner will recognize the relevance of the
condition to an index on creation_time, financial_document_id ...

            regards, tom lane


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

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: Postgres does not use indexes with OR-conditions
Следующее
От: David G Johnston
Дата:
Сообщение: Re: Postgres does not use indexes with OR-conditions