[wp-trac] [WordPress Trac] #55716: Prime users in cache in WP_Query

WordPress Trac noreply at wordpress.org
Fri Jun 10 13:38:08 UTC 2022


#55716: Prime users in cache in WP_Query
--------------------------------------+-----------------------------
 Reporter:  spacedmonkey              |       Owner:  spacedmonkey
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  Future Release
Component:  Query                     |     Version:  1.5
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+-----------------------------
Changes (by spacedmonkey):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"53482" 53482]:
 {{{
 #!CommitTicketReference repository="" revision="53482"
 Prime users cache in WP_Query and post REST API controller.

 For a call to `WP_Query` or a post REST API request that contains posts
 from multiple authors, call the `cache_users` function, to ensure that all
 user data for post authors is primed in
 a single database query. This results in far fewer database queries on
 multiple author sites.

 Props spacedmonkey, timothyblynjacobs, peterwilsoncc.
 Fixes #55716.
 }}}

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


More information about the wp-trac mailing list