Will the LIKE keyword use the index in SQLite and/or MySQL?
I would understand that a wildcard match might not use the index, but how about a starts with comparison?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends:
As long as the wildcard is at the start, no index can be used. If you have fixed data before a wildcard, then an index can be used.
Some db’s such as PostgreSQL have tricks that allow the use of indexes in all cases, but MySQL and SQLite do not.