Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 16913)
+++ wp-includes/comment.php	(working copy)
@@ -792,11 +792,28 @@
 		'trackback' => 'trackback',
 	);
 
-	$comtypewhere = ( 'all' != $args['type'] && isset($allowedtypes[$args['type']]) ) ? " AND comment_type = '" . $allowedtypes[$args['type']] . "'" : '';
 
-	// Count comments older than this one
-	$oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_approved = '1' AND comment_date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) );
+	if ( ($comsdatebypost = wp_cache_get( $comment->comment_post_ID, 'page_of_comment' )) == false ) {
+		$comtypewhere = ( 'all' != $args['type'] && isset($allowedtypes[$args['type']]) ) ? " AND comment_type = '" . $allowedtypes[$args['type']] . "'" : '';
 
+		// Count comments older than this one
+		$comslist = $wpdb->get_results( $wpdb->prepare( "SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_approved = '1'" . $comtypewhere, $comment->comment_post_ID ) );
+
+		$comsdatebypost = array();
+		foreach ($comslist as $pagecom) {
+			$comsdatebypost[] =  strtotime( $pagecom->comment_date_gmt );
+		}
+		wp_cache_add( $comment->comment_post_ID, $comsdatebypost,  'page_of_comment' );
+	}
+	
+	$oldercoms = 0;
+	
+	foreach($comsdatebypost as $comdate) {
+		if( $comdate < strtotime($comment->comment_date_gmt) ) {
+			$oldercoms++;
+		}
+	}
+
 	// No older comments? Then it's page #1.
 	if ( 0 == $oldercoms )
 		return 1;
