﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
21435,wp-includes/comment.php line85 causes slow query due to the non-indexed column,matsubobo,,"Following query is causes slow query if  the wp_comment table is huge.
{{{
$ok_to_comment = $wpdb->get_var(""SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' LIMIT 1"");                                                         
}}}

In my case, I have 600 thousand records in the wp_comments table and the query takes over 10 minutes to complete.

http://matsu.teraren.com/blog/wp-content/uploads/2012/08/a40b1291fd99413dc3057fbe0b792a93.png

To fix this issue, I added index on my running wordpress and returns 0.00sec.

I'll attach the patch for create table file.
",enhancement,new,normal,Awaiting Review,General,3.4.1,minor,,has-patch,
