How does one go from the slow queries log of MySQL to the template that’s the culprit?
We were getting throttled by the hosting service for slow queries and, based on a bunch of web searches I was able to delete the pagination markup in the weblog/comments template—which reduced the severity of our demands on the MySQL server to the point that they stopped throttling us.
However, there is still a steady stream of these bogus queries coming through:
SELECT COUNT(*) AS `numrows`
FROM (`exp_comments` c)
JOIN `exp_channel_titles` ct ON `ct`.`entry_id` = `c`.`entry_id`
WHERE `c`.`status` = ‘o’
AND c.channel_id = 1
AND `ct`.`status` != ‘closed’
AND `c`.`site_id` IN (‘1’)
AND (`ct`.`expiration_date` = 0 OR `ct`.`expiration_date` > 1368640798)