Re: Where clause efficiency using "IN" - Mailing list pgsql-novice

From Tom Lane
Subject Re: Where clause efficiency using "IN"
Date
Msg-id 7532.1098460596@sss.pgh.pa.us
Whole thread Raw
In response to Where clause efficiency using "IN"  (Sean Davis <sdavis2@mail.nih.gov>)
List pgsql-novice
Sean Davis <sdavis2@mail.nih.gov> writes:
> Just a quick general question:  Can someone comment on using where
> clauses like:
>    (sample = 2 OR sample = 3 OR sample = 4)
> as compared to
>    sample in (2,3,4)
> in terms of efficiency?

PG's parser expands the latter into the former, so there's no difference
for us.  This is probably not true on other DBMSes.

            regards, tom lane

pgsql-novice by date:

Previous
From: Sean Davis
Date:
Subject: Where clause efficiency using "IN"
Next
From: Steven Klassen
Date:
Subject: Re: Where clause efficiency using "IN"