Ion Silvestru <[EMAIL PROTECTED]> wrote:
> If we have a query where we compare a column to a set of values, then
> which is faster: OR or IN?
> Ex: OR: (mycol = "a") OR (mycol = "b") OR (mycol = "c") OR...
>     IN: (mycol IN "a", "b", "c" ...)
>     

IN is faster.  However, version 3.2.3 introduced an enhancement
to the SQLite optimizer that automatically converts the OR form
of the expression above into the IN form, thus taking advantage
of the increased speed of IN.  So for SQLite version 3.2.3, there
really is no difference between the two.

See http://www.sqlite.org/optoverview.html#or_opt

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to