According to the answer of choice of this question: https://stackoverflow.com/questions/3489041/mysqlerror-specified-key-was-too-long-max-key-length-is-1000-bytes
CREATE INDEX example_idx ON YOUR_TABLE(your_column(50)) Assuming that your_column is VARCHAR(100), the index in the example above will only be on the first 50 characters. Searching for data beyond the 50th character will not be able to use the index.
I don't think so. I think when query with a string longer than 50 chars, MySQL will first use the first 50 chars and index to get a match list (which generally will be a very short list), then search in that list without index.
Is it true that MySQL won't use index at all when the query string is longer than 50 chars?
Is it true that MySQL won't use index at all when the query string is longer than 50 chars?
- do you mean on the second pass after finding this short list which matches the index in under and over 50 characters?