[EMAIL PROTECTED] wrote:
LIKE is case-insensitive by default. To have it use your index, you
need to either make the index case-insensitive:

Thanks! It's clear now.

What's the point of using LIKE if you don't have any wildcards in the
pattern?

Actually I do have wildcards, this was just a test, my actual query
is:
var statement = connection.createStatement("SELECT * FROM addressBook
WHERE name LIKE ?1 OR email LIKE ?1");
statement.bindString(statement, 0, text + "%");

The optimization won't help you in this case anyway. From http://www.sqlite.org/optoverview.html : If the right-hand side is a parameter that is bound to a string, then no optimization is attempted.

Besides, your statement uses OR in the WHERE clause. An index can't be used for such query even if you had plain old equality test in place of LIKE.

Igor Tandetnik

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

Reply via email to