[wp-trac] [WordPress Trac] #57901: Only process queue in lazy loading meta api, if request id is in queue.

WordPress Trac noreply at wordpress.org
Sun Mar 19 22:42:32 UTC 2023


#57901: Only process queue in lazy loading meta api, if request id is in queue.
--------------------------------+------------------------------
 Reporter:  spacedmonkey        |       Owner:  (none)
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:  4.5
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  performance
--------------------------------+------------------------------

Comment (by peterwilsoncc):

 I'm not sure this is a problem.

 The goal of lazy loading is to reduce the number of database queries by
 reducing the number of queries to the `*meta` table.

 If the IDs presence is checked before lazy loading, the following code
 will result in an increase in db queries:

 {{{#!php
 <?php
 // Queue meta for terms 123, 456, 789 for lazy loading.
 get_term_meta( 444 ); // Query 1 with and without change.
 get_term_meta( 123 ); // Query 2 in changed code, no query in existing
 code.
 }}}

 This seems worse to me.

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


More information about the wp-trac mailing list