- 论坛徽章:
- 0
|
索引有code 和 email
WHERE a.code = '1' AND a.email = '2' and a.email = b.email
如果inner join的话,explain结果会出现use where
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a const code,email code 40 const 1
1 SIMPLE b ref email email 30 const 1 Using where
ON a.email = b.email WHERE a.code = 'afcc91ce71b558d0b687dfbbe5e0b3ba490f281e' AND a.email = 'fff@ff.com'
如果用left join
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a const code,email code 40 const 1
1 SIMPLE b ref email email 30 const 1
为什么呢?
谢谢 |
|