My site is experiencing heavy lagging caused by these 2 queries below:
SELECT sx5p1B_comments.comment_ID FROM sx5p1B_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 30920 AND user_id = 107563 AND comment_type != 'order_note' AND comment_type != 'webhook_delivery' ORDER BY sx5p1B_comments.comment_date_gmt DESC LIMIT 0,1
SELECT count(p.ID) FROM sx5p1B_posts as p LEFT JOIN sx5p1B_postmeta as pm ON pm.post_id = p.ID WHERE pm.meta_key = 1 and p.post_status = 'publish' and p.post_type = 'course'
1 . "webhook_delivery" this is not our theme or plugin query , this is some other plugin related .
2 . the second query is to get the course count in my courses tab you see :
this is a very small query with one join only .