join - log-queries-not-using-indexes and LIKE in MySQL -


i have "log-queries-not-using-indexes" enabled in mysql. have 1 query being logged mysql such i.e. query not using indexes. thing query uses e.g.

category '%fashion%' 

and if remove or change to

category = 'fashion' 

then says using indexes.

so when using in our query, mysql log not using indexes no matter what?

thanks

using clause %fashion% never use regular index. need full-text index if want kind of search.

remember varchar indexes on first part of string. so, if searching ocurrence of fashion on any part of string, index offer no improve performance since need search every single string.

however, if search first part this:

select * table field 'fashion%' 

then index used , helpful.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -