On Fri, 2004-10-22 at 09:07, Sean Davis wrote:
> 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?
I believe they are pretty much the same, in that the planner will turn
the in clause you have there into a series of ors. However, if it is a
subselect, then the planner can use a hashed aggregate method, as long
as the dataset can fit into memory, as defined by some setting, (I think
it's sort_mem, but I'm not completely sure).