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

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -