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