[wp-trac] [WordPress Trac] #27985: wp_enqueue_media() may be slow on very large sites

WordPress Trac noreply at wordpress.org
Wed Apr 23 05:33:43 UTC 2014


#27985: wp_enqueue_media() may be slow on very large sites
--------------------------+------------------------------
 Reporter:  mboynes       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  3.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  performance
--------------------------+------------------------------

Comment (by nacin):

 I kind of feared this one, but since it was run on the media list table I
 didn't think too much of it.

 We can change this to two queries, which would be faster:

 {{{
 SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND
 post_mime_type LIKE 'video/%' LIMIT 1
 SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND
 post_mime_type LIKE 'audio/%' LIMIT 1
 }}}

 There is no index on post_mime_type though, so this is till a where on
 however many attachment records there are.

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


More information about the wp-trac mailing list