id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 36953 Meta lazyloading can cause excessive calls to object cache boonebgorges DBrumbaugh10Up "`WP_Query` calls `wp_queue_posts_for_term_meta_lazyload()`, which in turn grabs the `{$taxonomy}_relationships` cache for each found post, for each taxonomy that they belong to. So if you're fetching 20 items, and each item is in 10 taxonomies, the process will require 200 cache gets. This is in addition to the dozens of other other cache priming gets that happens in `WP_Query`. On very high traffic sites running an object cache backend, the high volume calls to the cache can cause performance issues. A truly general fix would be `wp_cache_get_multi()`, which would allow functions like this to reduce cache roundtrips by one or two orders of magnitude. See #20875. In the meantime, two things to explore: 1. `WP_Query` decides whether to queue posts for termmeta lazyloading based on the value of 'update_term_meta_cache'. This should be more fine-grained. A new `WP_Query` parameter `lazyload_term_meta`, which would default to the value of `update_term_meta`, seems appropriate. This way, very high-traffic sites that don't use termmeta and thus don't need to lazyload it can disable the feature in a targeted way, via a `pre_get_posts` callback. 2. Look for ways to cut back on cache queries in the lazyload process. Not sure if that's feasible, since different posts keep their taxonomy relationships in different cache buckets, but it's worth looking into. 1 should be doable for 4.6. cc @patrickgarman, who brought this to my attention." defect (bug) closed normal 4.6 Query normal fixed good-first-bug needs-unit-tests has-patch performance