Split the main WP_Query posts query into two queries to avoid temp tables. Leverage cache to avoid second query in persistent cache environments. Props scribu, cheald, prettyboymp. see #18536

git-svn-id: https://develop.svn.wordpress.org/trunk@19918 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-02-14 15:09:35 +00:00
parent 5055a133d5
commit 021c55798e
5 changed files with 88 additions and 25 deletions

View File

@@ -139,13 +139,7 @@ if ( !function_exists('cache_users') ) :
function cache_users( $user_ids ) {
global $wpdb;
$clean = array();
foreach ( $user_ids as $id ) {
$id = (int) $id;
if ( !wp_cache_get( $id, 'users' ) ) {
$clean[] = $id;
}
}
$clean = _get_non_cached_ids( $user_ids, 'users' );
if ( empty( $clean ) )
return;