Re: Where clause efficiency using "IN"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
Cc: Postgres <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Where clause efficiency using "IN"
Date: 2004-10-22 15:56:36
Message-ID: 7532.1098460596@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Sean Davis <sdavis2(at)mail(dot)nih(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Steven Klassen 2004-10-22 16:00:13 Re: Where clause efficiency using "IN"
Previous Message Scott Marlowe 2004-10-22 15:42:16 Re: Where clause efficiency using "IN"