Search Postgresql Archives

Re: Which query is good - IN or OR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

2010/12/9 AI Rumman <rummandba@xxxxxxxxx>:
> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux