Support » Fixing WordPress » Hanging SQL Queries

  • I’ve been having a heck of a time lately with my site ( http://www.feedthehabit.com ) exceeding the CPU usage on http://www.Bluehost.com. I’ve been disabling plugins left and right to try to pinpoint it, but it’s still having issues. Here are a few sample queries that are taking a LONG Time:

    # Tue Oct 14 18:34:32 2008
    # Query_time: 269 Lock_time: 6 Rows_sent: 1 Rows_examined: 2
    use feedtheh_wrdp2;
    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = ‘2006-banshee-pyre-mountain-bike’ AND wp_posts.post_type = ‘post’ ORDER BY wp_posts.post_date DESC
    =========
    # Tue Oct 14 18:34:51 2008
    # Query_time: 283 Lock_time: 197 Rows_sent: 0 Rows_examined: 0
    use feedtheh_wrdp2;
    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = ‘2006-banshee-pyre-mountain-bike’ AND wp_posts.post_type = ‘post’ ORDER BY wp_posts.post_date DESC
    =========
    # Tue Oct 14 18:34:55 2008
    # Query_time: 276 Lock_time: 256 Rows_sent: 0 Rows_examined: 0
    use feedtheh_wrdp2;
    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = ‘delta-7-sports-releases-the-revolutionary-arantix-isotruss-mountain-bike-frame’ AND wp_posts.post_type = ‘post’ ORDER BY wp_posts.post_date DESC
    =========
    # Tue Oct 14 18:34:55 2008
    # Query_time: 274 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
    use feedtheh_wrdp2;
    SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (‘category’, ‘post_tag’) AND tr.object_id IN (64) ORDER BY t.name ASC
    =========
    # Tue Oct 14 18:34:57 2008
    # Query_time: 112 Lock_time: 105 Rows_sent: 1 Rows_examined: 2
    use feedtheh_wrdp2;
    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = ‘goodie-patrol-with-steamboat-powdercats’ AND wp_posts.post_type = ‘post’ ORDER BY wp_posts.post_date DESC
    =========
    # Tue Oct 14 18:34:59 2008
    # Query_time: 62 Lock_time: 55 Rows_sent: 10 Rows_examined: 1164
    use feedtheh_wrdp2;
    SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%horst%’) OR (wp_posts.post_content LIKE ‘%horst%’))) AND (wp_posts.post_status = ‘publish’) ORDER BY wp_posts.post_date DESC LIMIT 0, 10
    =========
    # Mon Oct 6 09:54:37 2008
    # Query_time: 68 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
    use feedtheh_wrdp2;
    SELECT option_value FROM wp_options WHERE option_name = ‘siteurl’
    =========

    Several are the same query, but with different posts. One seems to be with site search and the other… I have no clue.

    Anyone have any suggestions? I’m on PHP5 with FastCGI enabled. I’m tempted to install WP Super Cache, but I’m leery of some of the caching issues I’ll run into (sidebar not updating, categories not updating, negative SEO because the content will be crusty, etc.)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hanging SQL Queries’ is closed to new replies.