BadgeOS queries killed on WPEngine
-
Hi,
I’m using BadgeOS 1.4.4 (with the Community addon 1.2.0) on a site hosted on WPEngine. I’m having trouble with users being granted badges they haven’t actually earned yet.
Looking at the debug log I’m seeing a lot of errors like:
[01-Apr-2015 18:20:24] KILLED QUERY (17526 characters long generated in /nas/wp/www/cluster-2186/moremusical/wp-content/plugins/badgeos/includes/steps-ui.php:175): SELECT wp_posts.*, wp_p2p.* FROM wp_posts INNER JOIN wp_p2p WHERE 1=1 AND wp_posts.post_type = 'planning-award' AND ((wp_posts.post_status = 'publish')) AND (FIND_IN_SET(wp_posts.post_type,'forum,topic,reply') OR FIND_IN_SET(wp_posts.ID,'6,7,8,9,10,11,12,13,[...]')) AND (wp_p2p.p2p_type = 'planning-award-to-step' AND wp_posts.ID = wp_p2p.p2p_from AND wp_p2p.p2p_to IN (SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.ID IN (1609) AND wp_posts.post_type = 'step' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed' OR wp_posts.post_author = 93 AND wp_posts.post_status = 'private' OR wp_posts.post_author = 93 AND wp_posts.post_status = 'hidden') AND (FIND_IN_SET(wp_posts.post_type,'forum,topic,reply') OR FIND_IN_SET(wp_posts.ID,'6,7,8,9,10,11,12,[ ... ]')) ORDER BY wp_posts.post_date DESC )) ORDER BY wp_posts.post_date DESC LIMIT 0, 1
In the two places I’ve marked […] there is actually a great long list of numbers.
I’m guessing this might be due to using the Community Activity “Reply to a Forum Topic” step and similar in my badge steps.
WPEngine has a policy of killing queries which are too long.
Is there a way to rewrite these SQL queries so they don’t get so epically long?
This is pretty urgent for me, as my users are getting awarded badges they haven’t earned, which scuppers the whole system a bit!
- The topic ‘BadgeOS queries killed on WPEngine’ is closed to new replies.