Recently, I've had a number issues related to a popular blog on my server which uses MT and mysql. We made the switch to fastcgi (which seemed to help) but continue to struggle with the volume of comments and the load generated by mt-comments.cgi and mysql queries. Regarding the latter, I've monitored the slow queries on the server and identified what appears to be a fairly inefficient call, apparently made every time a new comment is generated (I'm not entirely sure what script the call originates from). Here are the details (output by mysqlsla):
Count : 3542 (60%)
Time (seconds): 7840 total, 2.21 avg, 2 to 21 max
95% of Time : 7028 total, 2.09 avg, 2 to 3 max
Lock (seconds): 1 total, 0.00 avg, 0 to 1 max
Rows sent : 42421 avg, 17741 to 42738 max
Rows examined : 84864 avg, 59980 to 85478 max
User : [username]
Database : [mt database]
SELECT comment_id, comment_author, comment_blog_id, comment_commenter_id, comment_email, comment_entry_id, comment_ip, comment_junk_log, comment_junk_score, comment_junk_status, comment_last_moved_on, comment_text, comment_url, comment_visible, comment_created_on, comment_created_by, comment_modified_on, comment_modified_by FROM mt_comment WHERE (comment_visible = 'S') AND (comment_blog_id = 'S') ORDER BY comment_created_on desc;
Remarkably, the mt_comment table only has 43675 rows making the number of rows examined somewhat perplexing. Having identified the above, I've noticed similar behavior on other MT Blogs I host.
I'm wondering if there's in MT tech guru who could suggest whether or not there is a solution to this ineffient query or what might be done to speed up its execution time.
Thank in advance!