It used to be the other way around (between was slower, wouldn't use
index), but now one of them is optimized into the other, can't
remember which.

On 7/23/06, Hartwig Wiesmann <[EMAIL PROTECTED]> wrote:
Hello,

I have read somewhere that BETWEEN is faster than the equivalent
expression using comparison operators.
Example:
    ... WHERE Column BETWEEN 1 AND 10
compared with
   ...WHERE Column >= 1 AND Column <= 10

The reason might be that for the first expression the column value
has to be retrieved from the database only once while for the second
statement it has to be done twice. So, is BETWEEN in general faster
when using SQLite?
The second question is what happens with the statement BETWEEN 1 AND
1. It seems to be that this statement using SQLite is identical with
the equality operator. But on another SQL system I made the
experience that this is not the case.

Hartwig




--
Cory Nelson
http://www.int64.org

Reply via email to