Mysql 为什么不用主键索引
SELECT
m.contractId
FROM
t_cms_contract_siteconfig s
LEFT JOIN t_cms_contract_main m ON m.contractId = s.contractid
WHERE
m.isDelete = 0
AND m.contractType IN ( ‘1602’, ‘1604’, ‘1607’, ‘1608’ )
AND m.contractNature IN ( ‘0’, ‘1’ )
AND m.contractState IN ( ‘8’, ‘9’, ‘10’, ‘11’, ‘12’, ‘13’ )
AND s.siteCode = ‘500109908000000744’
LIMIT 0,
10;
1 SIMPLE s ref index_sc_contractid,index_sc_siteCode,UK_t_cms_contract_siteconfig index_sc_siteCode 603 const 6 Using index condition
1 SIMPLE m ALL PRIMARY,INX_CMAIN_DELETE 2309554 Range checked for each record (index map: 0x21)
contractId为主键
where条件都没用到主键吧