[wp-trac] [WordPress Trac] #34848: Add support for updating post meta in bulk

WordPress Trac noreply at wordpress.org
Thu Apr 14 17:43:15 UTC 2016


#34848: Add support for updating post meta in bulk
------------------------------------------+-----------------------------
 Reporter:  patrickgarman                 |       Owner:  chriscct7
     Type:  enhancement                   |      Status:  assigned
 Priority:  normal                        |   Milestone:  Future Release
Component:  Options, Meta APIs            |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  performance
------------------------------------------+-----------------------------

Comment (by patrickgarman):

 It's been a while since I wrote it, but I'll try to answer your questions
 from memory.

 - I don't think WPDB handled the building of the SQL for all the queries
 correctly, but I'm not 100% sure without going back and testing which I
 can't do until next week.
 - Do you know how to update many metas via a single SQL statement without
 deleting and re-adding the metadata? I'm no DBA, but I couldn't find
 anything that would have worked the same way a single update would.
 - Going in bulk I think complicates things, if you insert 10 rows of data
 in a single SQL statement you get a single yes/no that it worked via
 straight SQL. So we could do a select to then pull all the IDs, not TOO
 innefficient. Normal inserts/updates just uses WPDB to pull the
 inserted/updated ID which I'm not sure how well that works if in some way
 all the queries could be moved to work with WPDB.

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


More information about the wp-trac mailing list