Re: Or selection on index versus union

Поиск
Список
Период
Сортировка
Искать
От
Douglas McNaught
Тема
Re: Or selection on index versus union
Дата
Msg-id
m2u0fw17vq.fsf@Douglas-McNaughts-Powerbook.local
Ответ на
Re: Or selection on index versus union (han.holl@informationslogik.nl)
Список
Дерево обсуждения
Or selection on index versus union han.holl@informationslogik.nl
Re: Or selection on index versus union kevin.kempter@dataintellect.com
Re: Or selection on index versus union han.holl@informationslogik.nl
Re: Or selection on index versus union Michael Fuhr <mike@fuhr.org>
Re: Or selection on index versus union han.holl@informationslogik.nl
Re: Or selection on index versus union "Jim C. Nasby" <jnasby@pervasive.com>
Re: Or selection on index versus union Douglas McNaught <doug@mcnaught.org>
han.holl@informationslogik.nl writes:

> PS We still have to be careful how to formulate conditions:
>
> where fase in ('1','2')
>
> is ok, and uses the index, but the logically identical:
>
> where position(fase in '12') >= 1
>
> does a sequential scan.

Right, you would need a functional index to fix that.  The query
optimizer, in general, doesn't know what specific functions
do--they're black boxes.  So there would be no way for the optimizer
to figure out that the two expressions mean the same thing.

-Doug
В списке pgsql-general по дате отправления
От: Neil Dugan
Дата:
От: Markus Schulz
Дата:
FAQ