First time using an Index - SQLite / Android
WHERE c = ?

This lookup can be optimized with a simple index on the c column:

CREATE INDEX T_c on T(c);

WHERE a LIKE ? || '%'

There are several restrictions on indexes that can be used for LIKE searches.
In this case, you need a case-insensitive index:

CREATE INDEX T_a_ci ON T(a COLLATE NOCASE);

WHERE b LIKE ? || '%'

same here:

CREATE INDEX T_b_ci ON T(b COLLATE NOCASE);

WHERE a LIKE ? || '%' AND b LIKE ? || '%'

The database can use at most one index per table in a query, so it will use one of the indexes above.
If you have run ANALYZE, it might be able to choose the better one.


To check which indexes are actually being used, use EXPLAIN QUERY PLAN.

Whenever you change tables, any indexes must be updated too.
When you're filling an empty table, it is usually a better idea to create indexes afterwards.

When your application does many updates to some table, it might be worthwhile omitting some index(es) that are useful only for seldomly-used queries.