Optimization of MySQL search using "like" and wildcards -


how can queries like

select * sometable somefield '%value%' 

be optimized?

the main issue here first wildcard prevents dbms using index.

edit: more, somefield value solid string (not piece of text) fulltext search not performed.

two ways:

(1) use in-memory table goes fast.

(2) cook better index , search algorithm foo '%bar%'. it's not possible make suggestions without knowing more problem.

as have pointed out, %bar% pattern guarantees table-scan every lookup, nullifies possible search ingenuity in database software.


Comments

Popular posts from this blog

List<T>().Add problem C# -

Javascript natural sort array/object and maintain index association -