[wp-trac] [WordPress Trac] #55889: Allow specifying multiple keys as an array in meta and option retrieval functions.

WordPress Trac noreply at wordpress.org
Wed Jun 1 12:24:44 UTC 2022


#55889: Allow specifying multiple keys as an array in meta and option retrieval
functions.
--------------------------------+------------------------------
 Reporter:  namith.jawahar      |       Owner:  (none)
     Type:  feature request     |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:  performance
--------------------------------+------------------------------

Comment (by namith.jawahar):

 Replying to [comment:1 knutsp]:
 > Why do you think would it be more efficient to specify multiple keys in
 the function call? The number of SQL queries generated when not cached?

 We can reduce the number of SQL calls (when not cached), the reduction
 should be drastic when the number of fetched fields is high.  Also we can
 get rid of the horrible practice of having to save meta values and options
 in arrays and serialized into the meta value field.  Developers do this to
 save of database calls.

 The update will need to go as far as the SQL query in update_meta_cache()
 and let it support an additional WHERE parameter for the meta keys in
 addition to the current IDs.

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


More information about the wp-trac mailing list