Omit the `ORDER BY` clause when updating object term cache.

The `ORDER BY` clause was forcing filesorts on large tables, and is
unnecessary, since term order doesn't matter when updating the cache.

Props mbrandys, wonderboymusic.
Fixes #28922.
Built from https://develop.svn.wordpress.org/trunk@34217


git-svn-id: http://core.svn.wordpress.org/trunk@34181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2015-09-15 20:53:33 +00:00
parent 4139daea5e
commit cfbd3c2cc0
2 changed files with 5 additions and 2 deletions

View File

@ -3274,7 +3274,10 @@ function update_object_term_cache($object_ids, $object_type) {
if ( empty( $ids ) )
return false;
$terms = wp_get_object_terms($ids, $taxonomies, array('fields' => 'all_with_object_id'));
$terms = wp_get_object_terms( $ids, $taxonomies, array(
'fields' => 'all_with_object_id',
'orderby' => 'none',
) );
$object_terms = array();
foreach ( (array) $terms as $term )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34216';
$wp_version = '4.4-alpha-34217';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.