[wp-trac] [WordPress Trac] #19973: Query Maxing Out CPU

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 5 22:57:45 UTC 2012


#19973: Query Maxing Out CPU
--------------------------+------------------------------
 Reporter:  ballhogjoni   |       Owner:  ballhogjoni
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Database      |     Version:  3.3.1
 Severity:  major         |  Resolution:
 Keywords:  close         |
--------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:  needs-patch => close


Comment:

 This query looks like the one from WPtouch Pro plugin, see
 `wptouch_wordpress_menu_has_children()` function in `wptouch-pro/include
 /template-tags/wordpress-menu.php`:
 {{{
 $sql = $wpdb->prepare( "SELECT count(*) as c FROM
 {$wpdb->base_prefix}posts WHERE ID IN (SELECT object_id FROM
 {$wpdb->base_prefix}term_relationships WHERE term_taxonomy_id = %d) AND ID
 IN (SELECT post_id FROM {$wpdb->base_prefix}postmeta WHERE meta_key =
 '_menu_item_menu_item_parent' AND meta_value = '%d') ORDER BY menu_order",
 $settings->custom_menu_name, $parent );
 }}}
 It's a premium plugin, not available in WP.org directory.

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


More information about the wp-trac mailing list