[wp-trac] [WordPress Trac] #16966: Query Causing MySQL to use all resources / crashes server

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 25 17:51:37 UTC 2011


#16966: Query Causing MySQL to use all resources / crashes server
-------------------------------+------------------------------
 Reporter:  user65             |       Owner:  scribu
     Type:  defect (bug)       |      Status:  reviewing
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  3.1
 Severity:  critical           |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------
Changes (by scribu):

 * keywords:  dev-feedback => reporter-feedback
 * owner:   => scribu
 * status:  new => reviewing


Comment:

 Here is the equivalent query from WP 3.0:

 {{{
 SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  INNER JOIN
 wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
 INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id =
 wp_term_taxonomy.term_taxonomy_id)  WHERE 1=1  AND
 wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN
 ('34') AND wp_posts.post_type = 'post' AND (wp_posts.post_status =
 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER
 BY wp_posts.post_date DESC LIMIT 0, 10
 }}}

 Could you run it and see if it's substantially faster?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16966#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list