Index: src/wp-admin/includes/schema.php
===================================================================
--- src/wp-admin/includes/schema.php	(revision 35769)
+++ src/wp-admin/includes/schema.php	(working copy)
@@ -187,7 +187,8 @@
   KEY post_name (post_name($max_index_length)),
   KEY type_status_date (post_type,post_status,post_date,ID),
   KEY post_parent (post_parent),
-  KEY post_author (post_author)
+  KEY post_author (post_author),
+  KEY post_type_mime_type (post_type, post_mime_type(10))
 ) $charset_collate;\n";
 
 	// Single site users table. The multisite flavor of the users table is handled below.
Index: src/wp-includes/media.php
===================================================================
--- src/wp-includes/media.php	(revision 35769)
+++ src/wp-includes/media.php	(working copy)
@@ -3213,7 +3213,7 @@
 	" );
 	$months = $wpdb->get_results( $wpdb->prepare( "
 		SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
-		FROM $wpdb->posts
+		FROM $wpdb->posts IGNORE INDEX (post_type_mime_type)
 		WHERE post_type = %s
 		ORDER BY post_date DESC
 	", 'attachment' ) );
Index: src/wp-includes/version.php
===================================================================
--- src/wp-includes/version.php	(revision 35769)
+++ src/wp-includes/version.php	(working copy)
@@ -11,7 +11,7 @@
  *
  * @global int $wp_db_version
  */
-$wp_db_version = 35700;
+$wp_db_version = 35769;
 
 /**
  * Holds the TinyMCE version
