我的主机说以下查询占用了大量服务器 CPU。请告诉我如何优化它。
SELECT COUNT(*) FROM (SELECT COUNT(*) AS tot,wallpapers.*,resolutions.res_height,resolutions.res_width FROM wallpapers
INNER JOIN analytics ON analytics.`wall_id` = wallpapers.`wall_id`
INNER JOIN resolutions ON resolutions.`res_id` = wallpapers.`res_id`
WHERE analytics.ana_date >= '2013-09-01 16:36:56' AND wallpapers.wall_status = 'public'
GROUP BY analytics.`wall_id`) as Q
请注意,分析表包含所有浏览量和点击量的记录。所以它非常非常大。