MySQL query (ver 5.1.61)
SELECT alerts.*,
devices.user_id
FROM alerts
left JOIN devices
ON alerts.device_id = devices.id
WHERE devices.name = 'myval'
There is an index on "alerts.device_id" MySQL in Explain does not use the index, it shows type "ALL" and rows being the full count of rows in the table.
I can't understand why it doesn't use this index. What am I missing?
Thanks!