Index: wp-admin/includes/comment.php
===================================================================
--- wp-admin/includes/comment.php	(revision 17581)
+++ wp-admin/includes/comment.php	(working copy)
@@ -115,7 +115,7 @@
 	$post_id_array = array_map('intval', $post_id_array);
 	$post_id_in = "'" . implode("', '", $post_id_array) . "'";
 
-	$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_A );
+	$pending = $wpdb->get_results( apply_filters( 'pending_comments_query', "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", $post_id ), ARRAY_A );
 
 	if ( $single ) {
 		if ( empty($pending) )
Index: wp-admin/includes/dashboard.php
===================================================================
--- wp-admin/includes/dashboard.php	(revision 17581)
+++ wp-admin/includes/dashboard.php	(working copy)
@@ -609,7 +609,7 @@
 	$total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] )
 		? absint( $widgets['dashboard_recent_comments']['items'] ) : 5;
 
-	while ( count( $comments ) < $total_items && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) {
+	while ( count( $comments ) < $total_items && $possible = $wpdb->get_results( apply_filters( 'dashboard_recent_comments_query', "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) ) {
 
 		foreach ( $possible as $comment ) {
 			if ( count( $comments ) >= $total_items )