Optimizing a query

Hi,

Any idea to optimize the next query:

SELECT
COUNT() - SUM(success) AS failed,
COUNT(
) AS total,
SUM(success) / COUNT(*) * 100 AS percent,
FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(TIME) / 300) * 300) AS START
FROM reports
GROUP BY FLOOR(UNIX_TIMESTAMP(TIME) / 300) LIMIT 100;

Thanks for the help.

You need to index it and rewrite it so that an index can be used for the GROUP BY. You should include SHOW CREATE TABLE reports\G