1、查询语句如下

EXPLAIN  SELECT  t.*   from    tbm_news_processing  t    where  t.title   like  '%测试%'      ;
EXPLAIN SELECT t.* from tbm_news_processing t where t.title regexp '.*测试.*' ;


SELECT t.* from tbm_news_processing t where t.title like '%测试%' ;
SELECT t.* from tbm_news_processing t where t.title regexp '.*测试.*' ;


2、监控耗时对比

Mysql 执行效率 REGEXP  与 %  查询效率 比较   mysql  查询  中文,模糊查询中文标题进行效率对比结果显示%执行较为快一些,EXPLAIN监控的时间是一样的_正则查询效率mysql中文

3、开发中使用查询方案:

<if test="null != searchVo.title  and  searchVo.title !=''">
and p.title REGEXP CONCAT('.*',#{searchVo.title},'.*')
</if>

改造为:

<if test="null != searchVo.title  and  searchVo.title !=''">
and p.title Like CONCAT('%',#{searchVo.title},'%')
</if>