Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition
Дата
Msg-id 2193.1286684811@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #5702: pg fails to use a conditional index even the where clause matches the condition  ("Corin" <info@netskin.com>)
Ответы Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition
Список pgsql-bugs
"Corin" <info@netskin.com> writes:
> CREATE INDEX fanobjects_amazon_product_id_index
>   ON fanobjects
>   USING btree
>   (amazon_product_id)
>   WHERE NOT amazon_product_id IS NULL;

Try it like

    WHERE amazon_product_id IS NOT NULL;

> I'd consider this a bug as "NOT x IS NULL" is the same as "x IS NOT NULL".

We don't expend an infinite number of cycles on rewriting different
query formulations into each other, and that's one of the ones we
don't handle ...

            regards, tom lane

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

Предыдущее
От: "Corin"
Дата:
Сообщение: BUG #5702: pg fails to use a conditional index even the where clause matches the condition
Следующее
От: Netskin | Corin Langosch
Дата:
Сообщение: Re: BUG #5702: pg fails to use a conditional index even the where clause matches the condition