Mysql does not use index exceptions
Mysql index today finds a strange thing about mysql: Table Structure:
Table index:
We can see that the ver is of the varchar type and has an index. Search for a piece of data that does not exist:
The type is actually all, And the rows is the whole table. Under what circumstances, no index is used? Search for a piece of data:
Normal !! It takes more than one second to remove explain from the previous type, and only 0.0 for the next type. This indicates that the previous type does not use indexes !! This is a wool situation! I think it is still helpful for indexing. No answer was found in the Manual. A burst of inspiration:
You can scale up 123 with a single lead. This is a good decision !!! Why? I did not find an official answer, but according to my experience, it is assumed that the string is converted into a number by comparing it with a number, this may disturb the index and lead to another conjecture. What if the data is a number and a string is searched? After my tests, I found that indexes will still be used. This is more in line with my previous conjecture, because the search condition is a string, but the search condition is converted to the index number, the index is not disturbed.