• Resolved balvan64

    (@balvan64)


    Hello,
    Using Query Monitor we’ve detected There is a very long query running on every page load:

    select * from wcsc_logs where ( ( end IS NULL ) or ( ( coalesce( result, '' ) != '' ) and ( result NOT IN ( 'skipped','completed','exited','in progress' ) ) ) ) and ( start > 16673982980000 ) and ( hook_name != 'wcsc_wp_cron' )

    This DB query increase the load time of every page by about 1 second, deactivating the plugin speeds up the website by 1 second, that is a lot. The rest of the DB queries made for the page generation each take less than 0.01 seconds.

    How can this be resolved?

    • This topic was modified 1 year, 10 months ago by balvan64.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author webheadcoder

    (@webheadllc)

    Hi,

    Apologies for the delayed response. This query needs to be run to check for cron jobs that haven’t finished properly. Do you have a lot of unfinished jobs running? Usually this will return 0 results.

    Thread Starter balvan64

    (@balvan64)

    Hello,
    1. No, we do not have any unfinished jobs.
    2. Why does it take so long? This is probably the most impactful thing on page load performance.

    Thank you

    Plugin Author webheadcoder

    (@webheadllc)

    Are you able to export and send me your wp_wcsc_logs table?

    You can email it to me at corey @ webheadcoder.com. Don’t upload it here as it may have some sensitive info in the results column if you had errors.

    For a temporary fix, you can also go to Settings->WP Cron Status and click on the “Clear Logs” button at the bottom of the page. It will clear your logs table and it should clear up your issue for now.

    Thread Starter balvan64

    (@balvan64)

    Hello,
    I suddenly see that this table is HUGE, 1,128,834 rows.

    Shouldn’t it be cleaned periodically?

    I discovered this thread: https://wordpress.org/support/topic/warning-on-size-of-wp_wcsc_logs/

    I have a feeling the issue might be a result of the size of the table?

    I’ve exported it but it is 135mb, I can’t send it.

    thank you

    • This reply was modified 1 year, 10 months ago by balvan64.
    Thread Starter balvan64

    (@balvan64)

    I’ve deleted the plugin and reinstalled it to clear the tables, but the table should have been cleared periodically.

    Plugin Author webheadcoder

    (@webheadllc)

    Glad you cleared up the slowness for now.

    I haven’t been able to reproduce the large table issue so I wasn’t able to fix it.

    Can you tell me what settings you have? (is email set? email freq? keep logs duration?)

    Also did you try the Clear All logs button and did it work?

    Sorry for all the questions.

    Thread Starter balvan64

    (@balvan64)

    The only way I can find to see the settings is with disabling then enabling the plugin, I cannot find any menu item for its settings.

    I put in an email, that’s all you can do in there.

    As I could not find the settings, I deleted the plugin, then reinstalled. I did not see the button.

    • This reply was modified 1 year, 10 months ago by balvan64.
    • This reply was modified 1 year, 10 months ago by balvan64.
    Plugin Author webheadcoder

    (@webheadllc)

    Do you see anything else besides the email text field on the Settings -> WP Cron Status page? It should look like the screenshot below.

    https://pasteboard.co/5jg0LqnWLXnO.png

    Are you on PHP 7 or higher?

    Thread Starter balvan64

    (@balvan64)

    Hello,
    We are using PHP 7.4

    The settings are:
    email set
    Incomplete Status – not checked
    Once a day
    24 hours
    Cleanup – checked

    thank you

    Plugin Author webheadcoder

    (@webheadllc)

    Thank you very much. Doesn’t look far off from what I have. I’ll keep trying to reproduce the issue though.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘a slow DB query runs on every page load’ is closed to new replies.