Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 6293)
+++ wp-includes/post.php	(working copy)
@@ -1632,6 +1632,8 @@
 
 	clean_object_term_cache($id, 'post');
 
+	wp_cache_delete( 'wp_get_archives', 'general' );
+
 	do_action('clean_post_cache', $id);
 }
 
Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 6293)
+++ wp-includes/general-template.php	(working copy)
@@ -394,7 +394,16 @@
 	$join = apply_filters('getarchives_join', "", $r);
 
 	if ( 'monthly' == $type ) {
-		$arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
+		$query = "SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC $limit";
+		$key = md5($query);
+		$cache = wp_cache_get( 'wp_get_archives' , 'general');
+		if ( !isset( $cache[ $key ] ) ) {
+			$arcresults = $wpdb->get_results($query);
+			$cache[ $key ] = $arcresults;
+			wp_cache_add( 'wp_get_archives', $cache, 'general' );
+		} else {
+			$arcresults = $cache[ $key ];
+		}
 		if ( $arcresults ) {
 			$afterafter = $after;
 			foreach ( $arcresults as $arcresult ) {
@@ -406,7 +415,16 @@
 			}
 		}
 	} elseif ('yearly' == $type) {
-         $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date DESC" . $limit);
+		$query = "SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date DESC $limit";
+		$key = md5($query);
+		$cache = wp_cache_get( 'wp_get_archives' , 'general');
+		if ( !isset( $cache[ $key ] ) ) {
+			$arcresults = $wpdb->get_results($query);
+			$cache[ $key ] = $arcresults;
+			wp_cache_add( 'wp_get_archives', $cache, 'general' );
+		} else {
+			$arcresults = $cache[ $key ];
+		}
 		if ($arcresults) {
 			$afterafter = $after;
 			foreach ($arcresults as $arcresult) {
@@ -418,7 +436,16 @@
 			}
 		}
 	} elseif ( 'daily' == $type ) {
-		$arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC" . $limit);
+		$query = "SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC $limit";
+		$key = md5($query);
+		$cache = wp_cache_get( 'wp_get_archives' , 'general');
+		if ( !isset( $cache[ $key ] ) ) {
+			$arcresults = $wpdb->get_results($query);
+			$cache[ $key ] = $arcresults;
+			wp_cache_add( 'wp_get_archives', $cache, 'general' );
+		} else {
+			$arcresults = $cache[ $key ];
+		}
 		if ( $arcresults ) {
 			$afterafter = $after;
 			foreach ( $arcresults as $arcresult ) {
@@ -432,7 +459,16 @@
 		}
 	} elseif ( 'weekly' == $type ) {
 		$start_of_week = get_option('start_of_week');
-		$arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC" . $limit);
+		$query = "SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC $limit";
+		$key = md5($query);
+		$cache = wp_cache_get( 'wp_get_archives' , 'general');
+		if ( !isset( $cache[ $key ] ) ) {
+			$arcresults = $wpdb->get_results($query);
+			$cache[ $key ] = $arcresults;
+			wp_cache_add( 'wp_get_archives', $cache, 'general' );
+		} else {
+			$arcresults = $cache[ $key ];
+		}
 		$arc_w_last = '';
 		$afterafter = $after;
 		if ( $arcresults ) {
@@ -453,7 +489,16 @@
 		}
 	} elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
 		('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC ";
-		$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit");
+		$query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
+		$key = md5($query);
+		$cache = wp_cache_get( 'wp_get_archives' , 'general');
+		if ( !isset( $cache[ $key ] ) ) {
+			$arcresults = $wpdb->get_results($query);
+			$cache[ $key ] = $arcresults;
+			wp_cache_add( 'wp_get_archives', $cache, 'general' );
+		} else {
+			$arcresults = $cache[ $key ];
+		}
 		if ( $arcresults ) {
 			foreach ( $arcresults as $arcresult ) {
 				if ( $arcresult->post_date != '0000-00-00 00:00:00' ) {

