[wp-trac] [WordPress Trac] #32264: wp_enqueue_media() is slow on large sites

WordPress Trac noreply at wordpress.org
Wed May 6 09:02:49 UTC 2015


#32264: wp_enqueue_media() is slow on large sites
-------------------------------+-----------------------------
 Reporter:  philipjohn         |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  3.9
 Severity:  normal             |   Keywords:
  Focuses:  performance        |
-------------------------------+-----------------------------
 Following on from #27985:

 Despite the improvements in #27985, it looks like wp_enqueue_media() is
 still slow on large sites.

 On WordPress.com VIP we're seeing multiple sites reporting very slow post
 saving. I've identified that the queries in [28194] are taking longer than
 3,500ms on saving posts.

 Here's debug bar output:

 {{{
 SELECT ID
 FROM wp_x_posts
 WHERE post_type = 'attachment'
 AND post_mime_type LIKE 'audio%'
 LIMIT 1
 include, wp_enqueue_media, wpdb->get_var, hyperdb->query #17 (3,599.6ms @
 6032.12ms)
 }}}

 and EXPLAIN on that query:

 {{{
 $wpdb->get_row("EXPLAIN SELECT ID FROM wp_x_posts WHERE post_type =
 'attachment' AND post_mime_type LIKE 'audio%' LIMIT 1", ARRAY_A);
 array(10) {
   'id' =>
   string(1) "1"
   'select_type' =>
   string(6) "SIMPLE"
   'table' =>
   string(17) "wp_x_posts"
   'type' =>
   string(3) "ref"
   'possible_keys' =>
   string(16) "type_status_date"
   'key' =>
   string(16) "type_status_date"
   'key_len' =>
   string(2) "22"
   'ref' =>
   string(5) "const"
   'rows' =>
   string(6) "253750"
   'Extra' =>
   string(11) "Using where"
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32264>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list