新浦京娱乐场官网mysql force index强制指定索引

2019-06-16 02:08栏目:技术创新

mysql可以通过force index关键字强制指定查询使用某个索引,如下sql语句:

select a.* from mvn_artifact a force index(IX_Path)
inner join (select artifactPath from mvn_artifact_tag where tagId = 361) as ap
on a.path like concat(ap.artifactPath,'%')
order by a.lastModifiedTime desc 
limit 0,20

mvn_artifact a后面用 force index(IX_Path)强制指定使用索引IX_Path.

版权声明:本文由新浦京娱乐站_新浦京娱乐场官网_新浦京娱乐发布于技术创新,转载请注明出处:新浦京娱乐场官网mysql force index强制指定索引