Use inner joins instead of left joins for taxonomy. Inner is faster. fixes #5179

git-svn-id: http://svn.automattic.com/wordpress/trunk@6224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2007-10-11 17:43:49 +00:00
parent a30ed0ded5
commit c674a475d7
3 changed files with 7 additions and 7 deletions

View File

@@ -1357,7 +1357,7 @@ function _pad_term_counts(&$terms, $taxonomy) {
}
// Get the object and term ids and stick them in a lookup table
$results = $wpdb->get_results("SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships LEFT JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (".join(',', array_keys($term_ids)).") AND post_type = 'post' AND post_status = 'publish'");
$results = $wpdb->get_results("SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (".join(',', array_keys($term_ids)).") AND post_type = 'post' AND post_status = 'publish'");
foreach ( $results as $row ) {
$id = $term_ids[$row->term_taxonomy_id];
++$term_items[$id][$row->object_id];