Ive been trying to get sqlite to use an index with a like to no avail. Ive tried collate nocase and still no luck. Anyone have any ideas on how to get sqlite to do a like hittin
From the docs:
Terms that are composed of the LIKE or GLOB operator can sometimes be used to constrain indices. There are many conditions on this use:
- The left-hand side of the LIKE or GLOB operator must be the name of an indexed column with TEXT affinity.
- The right-hand side of the LIKE or GLOB must be either a string literal or a parameter bound to a string literal that does not begin with a wildcard character.
- The ESCAPE clause cannot appear on the LIKE operator.
- The built-in functions used to implement LIKE and GLOB must not have been overloaded using the sqlite3_create_function() API.
- For the GLOB operator, the column must be indexed using the built-in BINARY collating sequence.
- For the LIKE operator, if case_sensitive_like mode is enabled then the column must indexed using BINARY collating sequence, or if case_sensitive_like mode is disabled then the column must indexed using built-in NOCASE collating sequence.