Support » Plugin: WooCommerce » Slow dashboard due to Slow Comment count query.

  • Resolved snehal13

    (@snehal13)


    Hi Team,
    I am facing this issue, where my dashboard loads really slow because the below query takes around 10 seconds, but the frontend works fine, the issue only appears on the backend.

    SELECT comment_approved, COUNT(*) AS num_comments
    FROM wp_comments
    WHERE comment_type NOT IN (‘order_note’, ‘webhook_delivery’)
    GROUP BY comment_approved

    I Got the details regarding slow query by using query monitor. Please help me with possible solutions.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • What is the total number of comments you have?

    The total number of comments i have is less than 500, but my comment section also shows woocommerce order notes and counting that i have 7500 comments,

    But i figured the issue, the comments table had 30000+ action_log rows as well, so i just added action_log to the where clause like this,

    SELECT comment_approved, COUNT(*) AS num_comments
    FROM wp_comments
    WHERE comment_type NOT IN (‘order_note’, ‘webhook_delivery’, ‘action_log’)
    GROUP BY comment_approved

    and this fixed my issue.

    Plugin Support Hannah S.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there,

    Thanks for letting us know how you handled this!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.