Slow site because of lots of queries to database?
-
When our host (Siteground) ran a trace on our website they discovered “thousands of queries” which is probably why our site is running slow. The problem is that I cant find out why so many queries are running? How do I find the origin to queries like this:
0.005444 sendto(5, " \4\0\0\3SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) JOIN wp_icl_translations wpml_translations\n\t\t\t\t\t\t\tON wp_posts.ID = wpml_translations.element_id\n\t\t\t\t\t\t\t\tAND wpml_translations.element_type = CONCAT('post_', wp_posts.post_type) WHERE 1=1 AND ( \n wp_term_relationships.term_taxonomy_id IN (671)\n) AND wp_posts.post_type = 'wccf_product_field' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private')) AND ( ( ( wpml_translations.language_code = 'sv' OR 0 ) AND wp_posts.post_type IN ('post','page','attachment','wp_block','blocks','wccf_product_field','product','product_variation','ufaq','featured_item' ) ) OR wp_posts.post_type NOT IN ('post','page','attachment','wp_block','blocks','wccf_product_field','product','product_variation','ufaq','featured_item' ) ) GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order ASC ", 1060, MSG_DONTWAIT, NULL, 0) = 1060
I see **JOIN wp_icl_translations** in there which means WPML has something to do with this example query but why are there so many of them?
Running WP 5.2.2 and the latest version of the plugins.
Thanks in advance.
- The topic ‘Slow site because of lots of queries to database?’ is closed to new replies.