开发者

MySQL Full-Text search vs Like %%

开发者 https://www.devze.com 2023-02-24 03:32 出处:网络
What are key differences and wh开发者_如何学Cat is a use case for both of them? Thanks!Full-text search is the kind of search based on special sort of index (full-text, obviously). So you get the powe

What are key differences and wh开发者_如何学Cat is a use case for both of them? Thanks!


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

0

精彩评论

暂无评论...
验证码 换一张
取 消