Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 12320)
+++ wp-includes/comment.php	(working copy)
@@ -674,17 +674,45 @@
 	if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent )
 		return get_page_of_comment( $comment->comment_parent, $args );
 
-	$allowedtypes = array(
-		'comment' => '',
-		'pingback' => 'pingback',
-		'trackback' => 'trackback',
-	);
+	switch ( $args['type'] ) {
+		case 'comment':
+			$comtype = 'comment';
+			$comtypewhere = " AND comment_type = ''";
+			break;
+		case 'pingback':
+			$comtype = 'pingback';
+			$comtypewhere = " AND comment_type = 'pingback'";
+			break;
+		case 'trackback':
+			$comtype = 'trackback';
+			$comtypewhere = " AND comment_type = 'trackback'";
+			break;
+		case 'pings':
+			$comtype = 'pings';
+			$comtypewhere = " AND ( comment_type = 'pingback' OR comment_type = 'trackback' )";
+			break;
+		default;
+			$comtype = 'all';
+			$comtypewhere = '';
+	}
 
-	$comtypewhere = ( 'all' != $args['type'] && isset($allowedtypes[$args['type']]) ) ? " AND comment_type = '" . $allowedtypes[$args['type']] . "'" : '';
+	$cachekey = 'post-' . $comment->comment_post_ID;
 
-	// 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 ) );
+	// Check the cache and set it up if it's not set (so we can use replace later on)
+	if ( false === $oldercoms_cache = wp_cache_get( $cachekey, 'comment_pages' ) ) {
+		$oldercoms_cache = array();
+		wp_cache_add( $cachekey, $oldercoms_cache, 'comment_pages' );
+	}
+	$oldercoms_cache = (array) $oldercoms_cache;
 
+	// Get comments older than this comment
+	$oldercoms = ( isset( $oldercoms_cache[$comtype] ) && isset( $oldercoms_cache[$comtype][$comment->comment_ID] ) ) ? $oldercoms_cache[$comtype][$comment->comment_ID] : false;
+	if ( false === $oldercoms ) {
+		$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 ) );
+		$oldercoms_cache[$comtype][$comment->comment_ID] = $oldercoms;
+		wp_cache_replace( $cachekey, $oldercoms_cache, 'comment_pages' );
+	}
+
 	// No older comments? Then it's page #1.
 	if ( 0 == $oldercoms )
 		return 1;
@@ -694,6 +722,22 @@
 }
 
 /**
+ * Clears the cache used by get_page_of_comment(). Is designed to be attached to the
+ * 'clear_page_of_comment_cache' action inside of wp_transition_comment_status();
+ *
+ * @since 2.9.0
+ * @uses wp_cache_delete() Does the cache deleting.
+ *
+ * @param string $new_status Unused
+ * @param string $old_status Unused
+ * @param object $comment Comment object that had it's status changed
+ * @return bool True on successful removal, false on failure
+ */
+function clear_page_of_comment_cache( $new_status, $old_status, $comment ) {
+	return wp_cache_delete( 'post-' . $comment->comment_post_ID, 'comment_pages' );
+}
+
+/**
  * Does comment contain blacklisted characters or words.
  *
  * @since 1.5.0
Index: wp-includes/default-filters.php
===================================================================
--- wp-includes/default-filters.php	(revision 12320)
+++ wp-includes/default-filters.php	(working copy)
@@ -210,8 +210,9 @@
 add_action( 'future_page',                '_future_post_hook',        5, 2 );
 add_action( 'save_post',                  '_save_post_hook',          5, 2 );
 add_action( 'transition_post_status',     '_transition_post_status',  5, 3 );
-add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce'        );
-add_action( 'wp_scheduled_delete',        'wp_scheduled_delete' );
+add_action( 'comment_form',        'wp_comment_form_unfiltered_html_nonce' );
+add_action( 'wp_scheduled_delete',        'wp_scheduled_delete'            );
+add_action( 'transition_comment_status',  'clear_page_of_comment_cache'    );
 
 // Post Image CSS class filtering
 add_action( 'begin_fetch_post_image_html', '_wp_post_image_class_filter_add'    );
