[wp-trac] [WordPress Trac] #57645: Implement lazy loading term meta in WP_Term_Query
WordPress Trac
noreply at wordpress.org
Fri Apr 21 09:22:19 UTC 2023
#57645: Implement lazy loading term meta in WP_Term_Query
--------------------------------------+---------------------------
Reporter: spacedmonkey | Owner: spacedmonkey
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.3
Component: Taxonomy | Version: 4.4
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+---------------------------
Changes (by spacedmonkey):
* owner: (none) => spacedmonkey
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"55671" 55671]:
{{{
#!CommitTicketReference repository="" revision="55671"
Taxonomy: Always lazily load term meta.
In [34529] introduced lazy loading of term meta. However, this was only in
the context of `WP_Query`. Other parts of the codebase, like
`WP_Term_Query` did not lazily load term meta. In this change, calls to
`update_termmeta_cache` are now replaced with `wp_lazyload_term_meta`,
that instead of priming term meta caches, just adds them to the queue to
be primed it ever called. This results in far less database queries, as
there a number of places where term meta is being primed unnecessarily and
never used. Adding everything to the term meta queue, also means that if
term meta is used, that is all loaded in a single database / cache call.
Props spacedmonkey, mukesh27, peterwilsoncc.
Fixes #57645.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57645#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list