Re: [sqlite] Re: Re: Re: Index usage with LIKE queries

2007-09-12 Thread ser-ega
IT> Try IT> IT> select * from test where rowid in IT> (select rowid from test where name like 'value' IT> union all IT> select rowid from test where email like 'value'); That seems to work... explain query plan select * from test where rowid in (select rowid from test where name like "b%"

[sqlite] Re: Re: Re: Index usage with LIKE queries

2007-09-12 Thread Igor Tandetnik
Griggs, Donald <[EMAIL PROTECTED]> wrote: Regarding: "I thought I can create two separate indexes" I believe sqlite can use at most *one* index per table in a select. However, you can create *compound* indicies (though all the restrictions pointed to by Dr. H still apply) Compound indexes

[sqlite] Re: Re: Re: Index usage with LIKE queries

2007-09-12 Thread Igor Tandetnik
[EMAIL PROTECTED] wrote: I get the index for LIKE working by specifying COLLATE in the CREATE TABLE: CREATE TABLE test (name STRING COLLATE NOCASE), but... 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