WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have asked at the plugin's (WordPress Popular Posts) support a few days ago, since no response hope to get some insight or help here. Thanks.

Hesitant to tweak settings like max_heap_table_size & tmp_table_size because kind of (naively?) hoping that such a popular plugin has a way of managing load.

On a rather popular site on a VPS the host is asking us to investigate constant, frequent tmp writes that is increasing server load. Any ideas on how to manage / decrease these?


Copying to tmp table | SELECT p.ID AS 'id', p.post_title AS 'title', p.post_date AS 'date', p.post_author AS 'uid' , ( IFNULL(v.pageviews, 0)/(IF ( DATEDIFF('2013-02-25 12:07:23', MIN(v.day)) > 0, DATEDIFF('2013-02-25 12:07:23', MIN(v.day)), 1) )) AS 'avg_views' FROM XXXXXX_posts p LEFT JOIN (SELECT id, SUM(pageviews) AS 'pageviews', day FROM (SELECT id, pageviews, day FROM XXXXXX_popularpostsdatacache WHERE day > DATE_SUB('2013-02-25 12:07:23', INTERVAL 1 WEEK) ORDER BY day) sv GROUP BY id) v ON p.ID = v.id WHERE p.post_status = 'publish' AND p.post_password = '' AND p.post_type IN('post','page') GROUP BY p.ID HAVING avg_views > 0.0000 ORDER BY avg_views DESC LIMIT 5 |
share|improve this question
If the site gets a lot of traffic you're best off passing this job to another service, either your analytics or the analytics provided by addthis.com or similar. To do it in WP there's no good way around the number of table writes if you're logging views. – sanchothefat Feb 26 '13 at 9:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.