[wp-trac] [WordPress Trac] #37189: In wp_term_query on cache ids

WordPress Trac noreply at wordpress.org
Mon Sep 5 02:02:09 UTC 2016


#37189: In wp_term_query on cache ids
--------------------------+------------------------------
 Reporter:  spacedmonkey  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Taxonomy      |     Version:  4.6
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  performance
--------------------------+------------------------------

Comment (by boonebgorges):

 Yes, let's do it.

 A couple comments on [attachment:37189.diff]:

 - It's not necessary to delete the cache incrementor on WP update. WP
 flushes all caches during the update process.
 - When `fields` is `all`, two queries will take place: `SELECT * ... WHERE
 [query conditions]` and `SELECT * ... WHERE t.term_id IN
 $non_cached_array`. This seems inefficient. Can we fix this so that the
 first query will be `SELECT t.term_id` instead?
 - Related: You handle `fields=all` one way and and all other values of
 `fields` another. I guess this takes advantage of the fact that
 `t.term_id` is one of the SELECTed fields for each other value of
 `fields`. This seems like a hack to me. Would the hack go away if we were
 doing a `SELECT t.term_id` query for all values of `fields`? What do you
 think is the wisest thing to do here?
 - Values of `fields` other than 'all' and 'ids' will *set* the cache, but
 they won't *use* the cache. Can we fix this? Should we?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37189#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list