1. 首页
  2. 区块链
  3. 比特币
  4. MySQL Like模糊查询速度太慢如何解决

MySQL Like模糊查询速度太慢如何解决

上传者: 2020-12-17 08:02:10上传 PDF文件 93KB 热度 22次
问题:明明建立了索引,为何Like模糊查询速度还是特别慢? Like是否使用索引? 1、like %keyword 索引失效,使用全表扫描。但可以通过翻转函数+like前模糊查询+建立翻转函数索引=走翻转函数索引,不走全表扫描。 2、like keyword% 索引有效。 3、like %keyword% 索引失效,也无法使用反向索引。 使用mysql的explain简单测试如下: explain select * from company_info where cname like ‘%小%’ explain select * from company_inf
下载地址
用户评论