Query for daily Popular boats update is slow:
INSERT INTO popu (boat_id,popu_qtty,popu_set)SELECT hits_what_id,count(*) as qtty,53 as thesetFROM hitsWHERE hits_what='boat'AND hits_timestamp>now()-31536000GROUP BY hits_what_idORDER BY qtty DESC LIMIT 30
Don't see how to optimize as there already is database index on required columns.
Current alerts use threshold of .5sec. Should add alternative alerts up to 5sec for expected slow queries.
Query for daily Popular boats update is slow:
INSERT INTO popu (boat_id,popu_qtty,popu_set)
SELECT hits_what_id,count(*) as qtty,53 as theset
FROM hits
WHERE hits_what='boat'
AND hits_timestamp>now()-31536000
GROUP BY hits_what_id
ORDER BY qtty DESC LIMIT 30
Don't see how to optimize as there already is database index on required columns.
Current alerts use threshold of .5sec. Should add alternative alerts up to 5sec for expected slow queries.