Re: TimeOf(Subselects|Joins)FromLargeTables? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: TimeOf(Subselects|Joins)FromLargeTables?
Date
Msg-id 15079.1086411353@sss.pgh.pa.us
Whole thread Raw
In response to Re: TimeOf(Subselects|Joins)FromLargeTables?  ("Dann Corbit" <DCorbit@connx.com>)
List pgsql-hackers
"Dann Corbit" <DCorbit@connx.com> writes:
> I think ... an in-list is going to do better than a list of constants
> separated by OR.

Right at the moment, there is no performance difference betweenWHERE foo IN (const1, const2, const3)
andWHERE foo = const1 OR foo = const2 OR foo = const3
because in fact the parser expands the former into the latter at
a pretty early stage.

Still, I'd suggest using the IN form when you can.  It's more
concise, arguably less prone to typos, and someday we might even
implement it more efficiently than the other form.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Official Freeze Date for 7.5: July 1st, 2004
Next
From: David Garamond
Date:
Subject: Re: [pgsql-advocacy] Not 7.5, but 8.0 ?