MySQL Full-Text search vs Like %%

ⅰ亾dé卋堺 提交于 2019-12-21 09:29:56

问题


What are key differences and what is a use case for both of them? Thanks!


回答1:


Full-text search is the kind of search based on special sort of index (full-text, obviously). So you get the power of O(lgN) while searching using it.

While like %% always causes table fullscan which can be terrible slow (when you have 100k and more rows).

Personally I use Like %% when it is a small table (0-1000 rows) and I'm sure that it will never grow (and, important, when like %% fits the task requirements).

Note: fulltext indexes are available only for myisam SE. If you use innodb - then you need to look at some 3rd party indexing software like sphinx



来源:https://stackoverflow.com/questions/5629491/mysql-full-text-search-vs-like

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!