• Hello,

    I noticed that my SQL is sometimes taking up to 400% CPU load.
    so i kept on monitoring my SQL till i found out that query is taking more than 7 mins to finish & its killing my server…
    that query takes 7 min 23 secs to run !

    Please help me to sort it out dedicated server is dying :/
    ——————————–
    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND ( wp_posts.ID IN (
    SELECT object_id
    FROM wp_term_relationships
    WHERE term_taxonomy_id IN (4565,5541)
    GROUP BY object_id HAVING COUNT(object_id) = 2
    ) ) AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’) GROUP BY wp_posts.ID ORDER BY RAND() DESC LIMIT 0, 10;
    ————————————

Viewing 1 replies (of 1 total)
  • Thread Starter m4r5h4ll

    (@m4r5h4ll)

    i had to get a script to kill that query when it takes more than 30sec
    but still would love to fix the main issue. so any ideas?

Viewing 1 replies (of 1 total)
  • The topic ‘Very HEAVY SQL Query’ is closed to new replies.