Re: <>(not equal to) in where clause can use index

Поиск
Список
Период
Сортировка
От Nicklas Avén
Тема Re: <>(not equal to) in where clause can use index
Дата
Msg-id 1297156506.8940.3.camel@ubuntu-nav
обсуждение исходный текст
Ответ на <>(not equal to) in where clause can use index  (AI Rumman <rummandba@gmail.com>)
Список pgsql-general
One way to get around the problem is often to do a left or right join,
use = instead of <> , and catch the rows with null in id field,
something like:

SELECT a.* from
table a LEFT JOIN tableb b on a.testfld=b.testfld
WHERE b.id is null;

This one will use indexes on testflda and testfldb an

HTH

/Nicklas

On Tue, 2011-02-08 at 15:09 +0600, AI Rumman wrote:
> Is it possible to add some operator class in Postgresql 9 so that
> <>(not equal to) in where clause can use index?
>
> If yes how?
>
> Any idea please.



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

Предыдущее
От: AI Rumman
Дата:
Сообщение: <>(not equal to) in where clause can use index
Следующее
От: Itagaki Takahiro
Дата:
Сообщение: Re: [HACKERS] Issues with generate_series using integer boundaries