(please don't top-post) Michele Pradella wrote: > so there's no way to use that kind of double column index on a select like > explain query plan select * from test where (CarPlate LIKE 'AA000%') AND > (DateTime>1); > because at least one field have to do with operator = correct?
No, the number of "initial columns" that use "=" might be zero. This query can user either an index that has DateTime as first column, or an index that has CarPlate as first column (if the column has text affinity, and if the index use a case-insensitive collation): CREATE INDEX indexA ON test(DateTime); CREATE INDEX indexB_for_LIKE ON test(CarPlate COLLATE NOCASE); To be able to use a normal (case-sensitive) index, you'd need to do a case-sensitive search: (CarPlate GLOB 'AA000*'). Regards, Clemens