Background of the issue:
We are experiencing very high database load when we enable WPML on our production site hidden link. The hosting company (WP Engine) says that this is related to the following query: SELECT COUNT(*) FROM wp_comments JOIN wp_icl_translations icltr? ON icltr?.element_id = wp_comments.comment_post_ID JOIN wp_posts ON wp_posts.ID = icltr?.element_id AND CONCAT(?, wp_posts.post_type) = icltr?.element_type LEFT JOIN wp_icl_translations icltr_comment ON icltr_comment.element_id = wp_comments.comment_ID AND icltr_comment.element_type = ? WHERE ( comment_approved = ? ) AND icltr?.language_code = ? AND (icltr_comment.language_code IS NULL OR icltr_comment.language_code = icltr?.language_code ) This is causing the database to fall over and take the site down. At the moment we have had to disable WPML.
Symptoms:
High database load causing the site to fall over when WPML is enabled.
Questions:
Can you please advise on what might be causing this?
What can we do to resolve it urgently?