Re: Problem using LIKE with FORCE INDEX...
It's because you have the wildcard (%) at the beginning of the search string.
If you were to replace the string to be 'ill%' it would use the index.
To use the index, you need to provide at least one of the leftmost letters, because without it, the optimizer doesn't know where to start looking in the index so it has to do a full scan to find what you are looking for.
Quote from:
http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html
"MySQL cannot use an index if the columns do not form a leftmost prefix of the index."
Subject
Views
Written By
Posted
8155
February 04, 2008 11:02AM
Re: Problem using LIKE with FORCE INDEX...
4252
February 04, 2008 05:08PM
3616
February 06, 2008 02:34AM
3476
February 13, 2008 01:19AM
3449
March 12, 2008 09:40AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.