Re: Which query is good - IN or OR

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Which query is good - IN or OR
Дата
Msg-id AANLkTimJf8820LBY07+zX84rWOjHi5CJrJ_ihDqhB_S4@mail.gmail.com
обсуждение исходный текст
Ответ на Which query is good - IN or OR  (AI Rumman <rummandba@gmail.com>)
Список pgsql-general
Hello

2010/12/9 AI Rumman <rummandba@gmail.com>:
> A simple query I can write in any of the following two ways:
> 1.
> Select col1
> from table
> where col2 in ('A','B');
> 2.
> Select col1
> from table
> where
>  col2 = 'A'
> or  col2 = 'B'
> Here IN condition may be more than two.
> I need to know which one is good for good performance.
> Any idea please.

It depends on real use case. In almost all cases these queries are almost same.

Regards

Pavel Stehule

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

Предыдущее
От: AI Rumman
Дата:
Сообщение: Which query is good - IN or OR
Следующее
От: Paul Taylor
Дата:
Сообщение: Tuning Postgres for single user manipulating large amounts of data