Make WordPress Core

Changeset 17652


Ignore:
Timestamp:
04/18/2011 08:38:59 PM (13 years ago)
Author:
ryan
Message:

More efficient term intersection query. Props tigertech. see #16706

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r17526 r17652  
    695695                $terms = implode( ',', $terms );
    696696
    697                 $where[] = "$primary_table.$primary_id_column IN (
    698                     SELECT object_id
     697                $where[] = "(
     698                    SELECT COUNT(1)
    699699                    FROM $wpdb->term_relationships
    700700                    WHERE term_taxonomy_id IN ($terms)
    701                     GROUP BY object_id HAVING COUNT(object_id) = $num_terms
    702                 )";
     701                    AND object_id = $primary_table.$primary_id_column
     702                ) = $num_terms";
    703703            }
    704704
Note: See TracChangeset for help on using the changeset viewer.