OR or IN ?

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема OR or IN ?
Дата
Msg-id 200810140833.21911.fluca1978@infinito.it
обсуждение исходный текст
Ответы Re: OR or IN ?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: OR or IN ?  (Scott Ribe <scott_ribe@killerbytes.com>)
Список pgsql-general
Hi all,
I've got a query with a long (>50) list of ORs, like the following:

SELECT colB, colC FROM table WHERE colA=X OR colA=Y OR colA=Z OR ....

Is there any difference in how postgresql manages the above query and the
following one?

SELECT colB, colC FROM table WHERE colA IN (X,Y,Z,...)

Which is the suggested index to use on colA to get better performances?

Thanks,
Luca

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: pg_hotbackup how to
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: OR or IN ?