My query is really slow; It takes 17 seconds to execute. It hits 100% CPU on Godaddy VPS. Any ideas what can be done?
This query:
SELECT
`gps_unit_location`.`idgps_unit`,
MAX(`gps_unit_location`.`dt`) dtmax
FROM `gps_unit_location`
GROUP BY 1
Explain
id='1', select type='SIMPLE', table='gps_unit_location', type='index', possible keys=NULL, key='fk_gps2', key len='5', ref=NULL, rows='368668', extra=''