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. git-svn-id: https://develop.svn.wordpress.org/trunk@34217 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e05586646a
commit
2d59d18e3a
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user