force index(idx_name) 强制使用索引用法小结


force index(idx_name)或者

use index(idx_name)

注意该语句的位置,都是在from 第一个表明的后边

e.g. 1 无join

select * 
from table_a
force index(idx_name)
where ......

e.g. 2 有jion

select *
from table_a 
force index(idx_name)
left join table_b
where ......


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM