[wp-trac] [WordPress Trac] #14254: update_meta_cache fails; query too large?

WordPress Trac noreply at wordpress.org
Tue Aug 13 01:14:05 UTC 2013


#14254: update_meta_cache fails; query too large?
--------------------------+-----------------------
 Reporter:  newpixel      |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  3.7
Component:  Cache         |     Version:  2.9.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------
Changes (by wonderboymusic):

 * keywords:  reporter-feedback dev-feedback => has-patch
 * milestone:  Awaiting Review => 3.7


Comment:

 Here's my take on this:

 1. You never want to arbitrarily update the meta cache for a billion posts
 at once, you only want to cache data as its read or as a page's bundle of
 posts is loaded. If you are loading 30,000 posts, chances are, you are
 only loading them once for something like an import. If your traffic is
 bursty, you are probably only having a subset of posts read at scale
 1. No function that accepts an arbitrary number of `$object_ids` that are
 passed to `update_meta_cache()` ever reads the return value of the
 function, so there's no downside to it returning false to skip the billion
 queries and cache adds
 1. When this function is called with any number of `$object_ids` greater
 than the filtered value of `meta_cache_limit`, we should just bail.

 My patch provides the `meta_cache_limit` filter and sets the default to
 1000

--
Ticket URL: <http://core.trac.wordpress.org/ticket/14254#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list