[wp-trac] [WordPress Trac] #40669: Proper query cache invalidation on queries meta queries

WordPress Trac noreply at wordpress.org
Fri Jun 23 01:16:41 UTC 2017


#40669: Proper query cache invalidation on queries meta queries
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  4.9
Component:  Query                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-unit-   |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------
Changes (by boonebgorges):

 * component:  Options, Meta APIs => Query
 * milestone:  Awaiting Review => 4.9


Comment:

 Thanks for the patch.

 Worth noting that this is *not* currently a bug in term queries, because
 `*_term_meta()` busts the `'terms'` incrementor. (You have removed this
 implementation and replaced it with your own strategy in
 [attachment:40669.diff].) At a glance, it does seem to be a bug in comment
 queries, though we should have tests that demonstrate this.

 What's the advantage of having a separate 'comment_meta' and 'term_meta'
 incrementor? The main argument I can think of is: The cache for queries
 that don't have a 'meta_query' could potentially be longer-lasting if kept
 separate. However, I'd argue that if you aren't using 'meta_query' very
 often, then you probably aren't adding/updating/deleting meta very often
 either, so the issue of frequent invalidation is probably mostly moot.
 Generally, it doesn't seem worth the additional maintenance overhead to
 have a separate incrementor.

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


More information about the wp-trac mailing list