Thursday, 15 August 2013

Mysql not using index. Why?

Mysql not using index. Why?

SELECT `Nen Straatnaam` as street, `Nen Woonplaats` as city,Gemeente,
Postcode, acn_distinct.zipcodes, acn_distinct.lat, acn_distinct.lng
FROM `acn_distinct` INNER JOIN crimes as c ON `Nen Woonplaats` = c.place
AND c.street_check =0
ORDER BY street ASC
Explain gives me this information.
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE c ref idx_place,idx_street_check,fulltext_place
idx_street_check 1 const 67556 Using temporary; Using filesort
1 SIMPLE acn_distinct ref ID_nen_woonplaats ID_nen_woonplaats
768 crimes.c.place 42 Using index condition
so why its not using suggested indexes?

No comments:

Post a Comment