Event Calendar plugin for WordPress – very slow MySQL queries?

I run a fairly active student blog that uses this event calendar plugin to display upcoming events for the students browsing.

I’ve noticed, however, that the site has been running slow recently. I found out that it’s because a particular set of MySQL queries related to the plugin take very long. Here are the two queries in question:

Read More
Count: 88  Time=236.08s (20775s)  Lock=0.00s (0s)  Rows=13.7 (1204), 
SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  LEFT JOIN wp_ec3_schedule ec3_sch ON ec3_sch.post_id=id  WHERE N=N  AND wp_posts.post_type = 'S' AND (wp_posts.post_status = 'S') AND ((YEAR(wp_posts.post_date)='S' AND MONTH(wp_posts.post_date)='S') OR ((YEAR(start)='S' AND MONTH(start)='S') OR (start<='S' AND end>='S')))  GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT N, N

Count: 19  Time=237.42s (4511s)  Lock=0.00s (0s)  Rows=5.4 (103), 
SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  LEFT JOIN wp_ec3_schedule ec3_sch ON ec3_sch.post_id=id  WHERE N=N  AND wp_posts.post_type = 'S' AND (wp_posts.post_status = 'S') AND ((YEAR(wp_posts.post_date)=N AND MONTH(wp_posts.post_date)=N) OR ((YEAR(start)=N AND MONTH(start)=N) OR (start<='S' AND end>='S')))  GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT N, N

I’m certain that it’s the plugin because the wp_ec3_schedule table was created by the plugin.

Has anyone dealt with this particular plugin before? Or, would anyone know why these queries would take long? As you can see, they’re taking almost 5 minutes, which is insane.

Related posts

Leave a Reply

1 comment

  1. Have you tried running an EXPLAIN on the two queries to see where the delays are? Also, check whether there are indexes on the tables being joined. The EXPLAIN would tell you whether the query is actually using the indexes as well.