SQLite Forum

Speed optimization for big single tabel searches
Login
If your searches were looking for a login that _started_ with "andy", then you could make the column collate nocase, and then use a normal index on it so it could be used with like. But if you are looking for something in the middle of the field, then normal indexes aren't going to cut it, and it will always need a full table scan.

You might be able to make use of the FTS extension(s) if you want to search on words in the field. But if you're possibly looking for any random substring, then I don't think that's something that can reasonably be indexed.