High CPU usage in AWS RDS

When I visit woocommerce orders page in wordpress, mysql RDS CPU usage goes to 100% but the website is working perfectly fine. In ‘active sessions’ section, "wait/io/tables/sql/handler" is showing cpu usage to 99%. I looked at the performance insights of the database and saw this strange query:

SELECT SQL_CALC_FOUND_ROWS `hbm_posts` . * , `low_stock_amount_meta` . `meta_value` AS `low_stock_amount` ,  MAX ( `product_lookup` . `date_created` ) AS `last_order_date` FROM `hbm_posts`  LEFT JOIN `hbm_wc_product_meta_lookup` `wc_product_meta_lookup` ON `hbm_posts` . `ID` =  `wc_product_meta_lookup` . `product_id` LEFT JOIN `hbm_postmeta` AS `low_stock_amount_meta`  ON `hbm_posts` . `ID` = `low_stock_amount_meta` . `post_id` AND `low_stock_amount_meta` .  `meta_key` = ? LEFT JOIN `hbm_wc_order_pro 

This query is not even complete and I can’t execute it in mysql shell. I have tried tracing back the query in wordpress, but can’t find it anywhere. I searched it with ‘string locator’, saw query logs in ‘query monitor’, tried disabling all plugins and also tried "define(‘SAVEQUERIES’, true);" as stated in this post:


What can I do to trace back this? Mysql version of server and client is 5.7.34