Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 17950)
+++ wp-includes/taxonomy.php	(working copy)
@@ -636,7 +636,26 @@
 		$where = array();
 		$i = 0;
 
-		foreach ( $this->queries as $query ) {
+		// convert AND queries to IN ones for more efficient SQL
+		if ( 'AND' == $this->relation ) {
+			$final_queries = array();
+			foreach ( $this->queries as $query ) {
+				if ( 'AND' == $query['operator'] && count( $query['terms'] ) <= 10 ) {
+					foreach ( $query['terms'] as $term ) {
+						$final_queries[] = array_merge( $query, array(
+							'terms' => $term,
+							'operator' => 'IN'
+						) );
+					}
+				} else {
+					$final_queries[] = $query;
+				}
+			}
+		} else {
+			$final_queries = $this->queries;
+		}
+
+		foreach ( $final_queries as $query ) {
 			$this->clean_query( $query );
 
 			if ( is_wp_error( $query ) ) {
