欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

mysql force index强制指定索引 强制使用索引 有大用

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.

来自 http://outofmemory.cn/code-snippet/12360/mysql-force-index

普通分类: