• Anyway to make the query below snappier?
    It’s eating up my site.

    I am not sure why it needs to examine 42236 rows…

    Time Id Command Argument
    # Time: 091101 13:24:48
    # Query_time: 7 Lock_time: 0 Rows_sent: 5 Rows_examined: 42236

    SELECT wp_posts.ID, wp_posts.post_title , (wp_popularpostsdata.pageviews/(IF ( DATEDIFF(CURDATE(), MIN(wp_popularpostsdata.day)) > 0, DATEDIFF(CURDATE(), MIN(wp_popularpostsdata.day)), 1) )) AS ‘avg_views’ , (SELECT wp_users.display_name FROM wp_users WHERE wp_users.ID = wp_posts.post_author ) AS ‘display_name’, wp_posts.post_date_gmt AS ‘date_gmt’ FROM wp_posts LEFT JOIN wp_popularpostsdata ON wp_posts.ID = wp_popularpostsdata.postid WHERE post_status = ‘publish’ AND post_password = ” AND wp_popularpostsdata.last_viewed >= ‘2009-11-01’ – INTERVAL 7 DAY AND pageviews > 0 AND wp_posts.post_type = ‘post’ GROUP BY postid ORDER BY avg_views DESC LIMIT 5;

    http://ww.wp.xz.cn/extend/plugins/wordpress-popular-posts/

Viewing 1 replies (of 1 total)
  • I’m aware of that problem. I’ve been working on a much more blog-friendly version of my plugin, however I haven’t had time to test it on a live site. If you want to, I can send you the beta files so you can test it.

    Let me know if interested!

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WordPress Popular Posts] Scaling issues – Slow Queries’ is closed to new replies.