mysql like 全文索引,MySQL全文搜索vs Like %%

全文搜索通过特殊索引提供高效的O(lgN)搜索能力,适合大规模数据。然而,LIKE%%操作可能导致全表扫描,对大型表性能影响显著。在小表和特定任务需求下,LIKE%%仍有一定应用价值。若使用InnoDB,推荐考虑第三方索引软件如Sphinx。
摘要由CSDN通过智能技术生成

20

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.

全文搜索是一種基於特殊索引的搜索(顯然是全文)。因此,在使用它時,您可以獲得O(lgN)的強大功能。

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

雖然像%%總是導致表fullscan可能很慢(當你有100k和更多行)。

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).

我個人使用Like %%,當它是一個小表(0-1000行)時,我確信它永遠不會增長(而且,重要的是,當%%符合任務要求時)。

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

注意:全文索引僅適用於myisam SE。如果您使用innodb - 那么您需要查看一些第三方索引軟件,如sphinx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值