SQL problem
Hi guys,
One of my queries is taking hours to give result. Both of them have the field 'eFaxId' which is integer and indexed. Can anyone explain why sql is not using the index key in first table ?
QUERY: select *
from eFax.e0806Q as a
left join eFax.e0806Link as b
on a.eFaxId = b.eFaxId
where b.eFaxId is Null
limit 100;
If I write EXPLAIN, this is the output i get.
id select_type table type possible_keys key key_len ref rows extra
--- ----------- ----- ---- ------------- --- ------- --- ---- -----
1, 'SIMPLE', 'a', 'ALL', '', '', '', '', 36726935, ''
1, 'SIMPLE', 'b', 'ALL', 'eFaxid', '', '', '', 30719078, 'Using where; Not exists'
Many thanks in advance.