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)
Список: pgsql-performance

Скрыть дерево обсуждения

Postgres does not use indexes with OR-conditions  (arhipov, )
 Re: Postgres does not use indexes with OR-conditions  (David Rowley, )
  Re: Postgres does not use indexes with OR-conditions  (Vlad Arkhipov, )
   Re: Postgres does not use indexes with OR-conditions  (Andrew Dunstan, )
    Re: Postgres does not use indexes with OR-conditions  (Kevin Grittner, )
     Re: Postgres does not use indexes with OR-conditions  (Tom Lane, )
     Re: Postgres does not use indexes with OR-conditions  (David G Johnston, )

Kevin Grittner <> 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 по дате сообщения:

От: David G Johnston
Дата:
Сообщение: Re: Postgres does not use indexes with OR-conditions
От: Ruben Domingo Gaspar Aparicio
Дата:
Сообщение: Postgres slave not catching up (on 9.2)