[wp-trac] [WordPress Trac] #39716: Improve update_meta_cache's performance when called with one object ID

WordPress Trac noreply at wordpress.org
Sat Jan 16 18:14:52 UTC 2021


#39716: Improve update_meta_cache's performance when called with one object ID
--------------------------------+--------------------------
 Reporter:  macprawn            |       Owner:  (none)
     Type:  enhancement         |      Status:  closed
 Priority:  normal              |   Milestone:
Component:  Options, Meta APIs  |     Version:  4.8
 Severity:  normal              |  Resolution:  invalid
 Keywords:  close               |     Focuses:  performance
--------------------------------+--------------------------
Changes (by hellofromTonya):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Closing this ticket. Why? As noted, the performance here will be the same
 between `IN(1)` and `=1` and the trade-off of additional code adds
 complexity.
 >The MySQL query optimizer (which runs on all queries regardless) will
 optimize a IN(1) and =1 query the same way AFAIK, branching in PHP to
 perform a separate code branch here is unlikely to save any significant
 CPU time in the scheme of performing a query but would certainly add code
 and debugging complexity for future maintainers.

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


More information about the wp-trac mailing list