Nitin Gupta
asked 9 years ago

I am managing the website where DW Focus theme is installed. The site is pretty big more than 60,000 posts and there are few queries that are loading the DB server and even making it crash. I am listing couple of them here. Please suggest how these can be optimized as we can’t afford site being down for any time because of the DB server crashing under load.

SELECT   wp_posts.ID FROM wp_posts  INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') AND (wp_postmeta.meta_key = '_views' ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 DESC LIMIT 0, 5;
SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  WHERE 1=1  AND (((wp_posts.post_title LIKE '%her%') OR (wp_posts.post_content LIKE '%her%')) AND ((wp_posts.post_title LIKE '%source%') OR (wp_posts.post_content LIKE '%source%')) AND ((wp_posts.post_title LIKE '%vices%') OR (wp_posts.post_content LIKE '%vices%')))  AND (wp_posts.post_password = '')  AND wp_posts.post_type IN ('post', 'attachment', 'incsub_wiki') AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC LIMIT 40, 10;
1 Answers
answered 9 years ago

Thank your for posting on our community. You’re a great guy, my friend 🙂
I have checked on our demo site, that’s right. We have a technical team to fix it. We will finish it as soon as possible. Please stay tuned and let you know one done.

Powered by DW Question & Answer Pro