Query overload and kill server
-
hi,
I am using ver 3.3.4
The 24h popular vote was working fine for many months, then it showed no data on the widget window for past few days. Today I changed the time frame to 7 days and it crashed the server after few hours.
This is query that cause high CPU load and timeout
SELECT p.ID AS ‘id’, p.post_title AS ‘title’, p.post_date AS ‘date’, p.post_author AS ‘uid’, SUM(v.pageviews) AS ‘pageviews’ FROM wp_popularpostssummary v LEFT JOIN wp_posts p ON v.postid = p.ID WHERE 1 = 1 AND p.post_type = ‘post’ AND p.ID IN (
SELECT object_id
FROM wp_term_relationships AS r
JOIN wp_term_taxonomy AS x ON x.term_taxonomy_id = r.term_taxonomy_id
WHERE x.taxonomy = ‘category’ AND x.term_id IN(106,98,107,60,99,137,108,165)
) AND v.last_viewed > DATE_SUB(‘2017-09-22 19:51:13’, INTERVAL 1 WEEK) AND p.post_password = ” AND p.post_status = ‘publish’ GROUP BY v.postid ORDER BY pageviews DESC LIMIT 15If I update to latest version, would this be fixed? I have 13,000+ posts in my DB.
Thanks,
Calvin
[email protected]
- The topic ‘Query overload and kill server’ is closed to new replies.