Answer the question
In order to leave comments, you need to log in
Is it possible and necessary to make an index on varchar?
Cheer everyone.
I have a table with several fields. there are indexes on fields with type INT - everything is quickly searched for with an exact query
there is a field with type varchar and non-unique data. there are several tens of millions of strings and it became necessary to search like %...% - is it possible to somehow speed up such a search and how to do it?
Answer the question
In order to leave comments, you need to log in
Index search in MYSQL only works like this: LIKE ...%
www.mysql.ru/docs/man/MySQL_indexes.html
From worst to best:
1) innodb + like + index (however, note that '%..%' index is not used, but '...%' is used)
2) change to myisam + full text search index
3) if you need something like a site search, then sphinx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question