Does index on a varchar column make the query run slower?
I can make that be int. and I don’t need to do the LIKE % comparison.
Does index on a varchar column make the query run slower? I can make
Share
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.
No, it does not.
If the optimizer decides to use of the index, the query will run faster.
INSERTs/UPDATEs/DELETEs on that table will be slower, but not likely enough to notice.Be aware that using:
…will not use an index, but the following will:
The key is wildcarding the lefthand side of the string means that an index on the column can’t be used.
Also know that MySQL limits the amount of space set aside for indexes – they can be up to 1000 bytes long for MyISAM (767 bytes for InnoDB) tables.