Добрый день, помогите плз создать индекс
запрос такой:
SELECT host_name, item_name, logeventid, COUNT(logeventid) AS num
FROM
(select h.name AS host_name, i.name AS item_name, i.key_, FROM_UNIXTIME(hs.clock) AS last_time, hs.value, hs.logeventid
from
hosts h
join items i on h.hostid = i.hostid
join history_log hs on i.itemid = hs.itemid
where hs.clock > UNIX_TIMESTAMP() - 86400 * 30
order by last_time, item_name) w
GROUP BY item_name, host_name
INTO OUTFILE '/tmp/test.csv' FIELDS TERMINATED BY ';' ;