• Resolved Maisonwhite

    (@maisonwhite)


    I am getting CPU Abuse messages from my Host Siteground due to slow queries, I think I have identified the cause being the Woocommerce Reports custom fields, the script is as below; caan anyone confirm this could be the cause?

    1. Executed 2h 5m 41s ago for 7.112051 sec on Database –> Unknown (NOT FOUND / DELETED)
    Date: 2020-02-20 23:35:03 Query_time: 7.112051 Rows_examined: 3407728: Rows_sent 13 Lock_time: 0.000176
    # Schema: maisonwh_wp567 Last_errno: 0 Killed: 0 SELECT SUM( meta__order_total.meta_value) as total_sales,SUM( meta__order_shipping.meta_value) as total_shipping,SUM( meta__order_tax.meta_value) as total_tax,SUM( meta__order_shipping_tax.meta_value) as total_shipping_tax, posts.post_date as post_date FROM wp_posts AS posts INNER JOIN wp_postmeta AS meta__order_total ON ( posts.ID = meta__order_total.post_id AND meta__order_total.meta_key = ‘_order_total’ ) INNER JOIN wp_postmeta AS meta__order_shipping ON ( posts.ID = meta__order_shipping.post_id AND meta__order_shipping.meta_key = ‘_order_shipping’ ) INNER JOIN wp_postmeta AS meta__order_tax ON ( posts.ID = meta__order_tax.post_id AND meta__order_tax.meta_key = ‘_order_tax’ ) INNER JOIN wp_postmeta AS meta__order_shipping_tax ON ( posts.ID = meta__order_shipping_tax.post_id AND meta__order_shipping_tax.meta_key = ‘_order_shipping_tax’ ) WHERE posts.post_type IN ( ‘shop_order’ ) AND posts.post_status IN ( ‘wc-completed’,’wc-processing’,’wc-on-hold’,’wc-refunded’) AND posts.post_date >= ‘2019-02-21 00:00:00’ AND posts.post_date < ‘2020-02-21 00:00:00’ GROUP BY YEAR(posts.post_date), MONTH(posts.post_date) ORDER BY post_date ASC;

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Woocomerce Reports CPU usage’ is closed to new replies.