Make WordPress Core


Ignore:
Timestamp:
10/15/2007 08:14:56 PM (17 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/wp-includes/taxonomy.php

    r6159 r6253  
    13581358
    13591359    // Get the object and term ids and stick them in a lookup table
    1360     $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'");
     1360    $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'");
    13611361    foreach ( $results as $row ) {
    13621362        $id = $term_ids[$row->term_taxonomy_id];
Note: See TracChangeset for help on using the changeset viewer.