Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 12600)
+++ wp-includes/query.php	(working copy)
@@ -2248,8 +2248,18 @@
 		$found_rows = '';
 		if ( !empty($limits) )
 			$found_rows = 'SQL_CALC_FOUND_ROWS';
-
-		$this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
+		
+		//////// BELOW CODE MODIFIED BY DAVE BUCHANAN, SPLIT INTO TWO QUERIES /////////////////////
+		/// FIRST SELECT JUST IDs
+		$tmp = " SELECT $distinct $wpdb->posts.id FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
+		$tmp_q = $wpdb->get_col($tmp);
+		$tmp_ids = implode($tmp_q,',');
+		
+		/// NOW NORMAL SELECT WHERE ID IS IN FIRST QUERY LIST
+		$this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE $wpdb->posts.id IN ($tmp_ids) $groupby $orderby ";
+		
+		////OLD ONE ///$this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
+		
 		if ( !$q['suppress_filters'] )
 			$this->request = apply_filters('posts_request', $this->request);
 
@@ -2272,7 +2282,9 @@
 		}
 
 		if ( !empty($limits) ) {
-			$found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' );
+			////OLD ONE///$found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' );
+			////Dave Buchanan Changed below
+			$found_posts_query  = " SELECT $distinct count($wpdb->posts.id) FROM $wpdb->posts $join WHERE 1=1 $where";
 			$this->found_posts = $wpdb->get_var( $found_posts_query );
 			$this->found_posts = apply_filters( 'found_posts', $this->found_posts );
 			$this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']);
