OR or IN ? - Mailing list pgsql-general

From Luca Ferrari
Subject OR or IN ?
Date
Msg-id 200810140833.21911.fluca1978@infinito.it
Whole thread Raw
Responses Re: OR or IN ?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: OR or IN ?  (Scott Ribe <scott_ribe@killerbytes.com>)
List 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 by date:

Previous
From: Craig Ringer
Date:
Subject: Re: pg_hotbackup how to
Next
From: "A. Kretschmer"
Date:
Subject: Re: OR or IN ?