Getting KILLED QUERY errors

Home Forums Calendar Products Events Calendar PRO Getting KILLED QUERY errors

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1141136
    John
    Participant

    I don’t see any functional problems with our calendar.

    The Events Calendar – Version 4.2.2
    The Events Calendar PRO – Version 4.2.2.1

    I’m getting the following errors from Events Calendar Pro on my multisite:

    [Mon Jul 18 07:31:03.155277 2016] [:error] [pid 20592] [client xx.xxx.xx.xxx:xxxxx KILLED QUERY (53138 characters long generated in /nas/content/live/xxxxxxxxx/wp-content/plugins/the-events-calendar/src/Tribe/Template/Month.php:488): SELECT t.*, tt.*, tr.object_id FROM wp_5_terms AS t INNER JOIN wp_5_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_5_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (‘post_tag’, ‘tribe_events_cat’) AND tr.object_id IN (5889, 6731, 5281, 6128, …

    Can’t reproduce the error messages in staging site.

    #1141346
    Brook
    Participant

    Howdy John,

    I would love to help you with this.

    I am guessing you probably have a month somewhere on your calendar with many hundreds of events. And when you visit that page this error happens. The Query that your server is killing determines which category each event is in. It runs once each time you load month view. Each event in the month has a numeric ID like 5889. If there are hundreds of events in the month, there will be hundreds of IDs in the query. And with enough IDs you could get a query that is 53138 characters long as the error states.

    Are you on WP Engine perchance? They are the only ones I have seen kill “long queries” like that. When you google around for that error so far the only host I’ve seen associated with it is WP Engine.

    You are probably safe enough to ignore this. We are working on some performance optimizations, and a side effect of them will likely be fewer IDs included in that tax query. The only option would be to find which Month is generating this error by examining your logs in more detail, and then deleting some events from it until the error goes away. WP Engine can handle only so many events in a given month.

    Does that all make sense? Will that work for you? Please let me know.

    Cheers!

    – Brook

    #1143077
    John
    Participant

    Thank you for your insights Brook. I understand the problem better now. Yes, we are using WP Engine. Great Sleuthing 🙂

    We have roughly 90 to 120 classes and events each month.

    I think the error message is generated when anyone views are monthly calendar. In this case July.

    I notice this in the error code: …wp-content/plugins/the-events-calendar/src/Tribe/Template/Month.php:491)
    and noticed another error with “Month.php:492.” Does 491 and 492 depict different months?

    When I begin viewing subsequent months, the December calendar freezes and doesn’t load.

    It would be a loss not be able to show all our classes. If we used less tags would that help?
    Tags: 223
    Categories: 13

    Again, I appreciate your help.

    #1143078
    John
    Participant

    This reply is private.

    #1143143
    John
    Participant

    We’ve found the problem. One of our recurring events has created approximately 7120 instances of the event for December 5, December 12, December 19, December 26.

    What would the best way to remove them?

    #1143431
    Brook
    Participant

    Nice! That’s crazy it created so many recurrences on that day. There was a bug briefly in our plugin that caused some extra recurrences to get created. I wonder if that might be responsible here?

    We built a tiny little cleanup plugin that is intended to cleanup recurrences like that. More information about the bug and cleanup plugin can be found in this article. If I were you I think I would install and activate that plugin as outlined. It runs in the background of your server so that it does not slow things down very much, and it runs briefly once each hour until the whole site is cleaned up. So if you install it now and give it some time, it seems very likely all those recurrences will disappear without you lifting another finger. If they don’t though then there is one other method for this involving running this SQL query. I can walk you through this if you prefer to directly edit the database like that instead.

    Thanks for getting back John. I am happy you got to the root cause of this, especially before December rolls around.

    • Brook
    #1151484
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Getting KILLED QUERY errors’ is closed to new replies.