[wp-trac] [WordPress Trac] #16621: Check term cache in _transform_terms()

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 23 19:21:50 UTC 2011


#16621: Check term cache in _transform_terms()
--------------------------+-----------------------------
 Reporter:  misterbisson  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  3.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 WP3.1's awesome new taxonomy query stuff rocks, but
 WP_Tax_Query->_transform_terms() seems to be executing multiple identical
 queries on each page load. The front page of one of my sites gives me five
 of the following query:

 {{{
 SELECT wp_1_term_taxonomy.term_taxonomy_id
 FROM wp_1_term_taxonomy
 INNER JOIN wp_1_terms USING (term_id)
 WHERE taxonomy = 'channel'
 AND wp_1_terms.slug IN ('tech')
 }}}

 I understand the function can do a lot more than map a single
 term+taxonomy to a term_taxonomy_id, but it also looks like there'd be
 some performance benefit from checking the term cache rather than the DB
 in those situations.

 Or, perhaps it'd be enough to simply cache the result for the duration of
 the page load.

 Or, maybe I'm focusing on the wrong problem, as the query takes just 1-2ms
 to execute.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16621>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list