Slow Database Query – Slow WordPress Dashboard

Home Forums Calendar Products Events Calendar PRO Slow Database Query – Slow WordPress Dashboard

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1128207
    Kristine
    Participant

    Hi,

    We are hosting with WP Engine and noticing some really slow Dashboard speeds. When we de-activate The Events Calendar (Pro), the speed improves by 1-2 seconds per page in the Dashboard. We have 995 events (mostly recurring). It takes 10 seconds to load the Event list in the Dashboard.

    We are getting the following Slow Query warning from The Query Monitor:

    SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, tribe_event_start_date.meta_value as EventStartDate, tribe_event_end_date.meta_value as EventEndDate
    FROM wp_posts
    LEFT JOIN wp_postmeta as tribe_event_end_date
    ON ( wp_posts.ID = tribe_event_end_date.post_id
    AND tribe_event_end_date.meta_key = ‘_EventEndDate’ )
    LEFT JOIN wp_postmeta AS tribe_event_start_date
    ON wp_posts.ID = tribe_event_start_date.post_id
    AND tribe_event_start_date.meta_key = ‘_EventStartDate’
    WHERE 1=1
    AND wp_posts.post_type = ‘tribe_events’
    AND (wp_posts.post_status = ‘publish’
    OR wp_posts.post_status = ‘acf-disabled’
    OR wp_posts.post_status = ‘future’
    OR wp_posts.post_status = ‘draft’
    OR wp_posts.post_status = ‘pending’
    OR wp_posts.post_status = ‘private’)
    ORDER BY tribe_event_end_date.meta_value DESC, tribe_event_start_date.meta_value DESC, wp_posts.post_date DESC
    LIMIT 0, 100 /* From [intercambio.org/wp-admin/edit.php?post_type=tribe_events&orderby=end-date&order=desc&ids=3387%2C2513%2C2512%2C2492%2C2456%2C1136%2C1229%2C1226%2C2457%2C2455%2C1132%2C1134%2C2317%2C1807%2C2250%2C2249%2C2248%2C2458%2C2298%2C1769%2C1773%2C1801%2C1227%2C2244%2C1222%2C1104%2C1133%2C1802%2C1735%2C1805%2C1112%2C1728%2C1111%2C1233%2C1127%2C1684%2C1683%2C1671%2C1232%2C1125%2C1014%2C1122%2C1121%2C1124] in [N/A] */

    I’ve set up the transient cache for the monthly view. Even so, the month view takes 7 seconds to load 6 seconds of which is just waiting for the query to complete. The rest of the page content loads in about 1 second. Tested on staging and removed plugins, and slow query still exists and speed is not much better on front end.

    Any advice would be awesome!

    Thanks!

    #1128405
    Brook
    Participant

    Howdy Kristine,

    I would love to help you with this. Thank you so much for diving in already and sharing what you have learned, very helpful.

    I am  especially interested in the Month View slowness. We do have a couple of performance improvements coming down the pipes, that resulted from our last performance audit a ~month back. But we are always interested in collecting more info and seeing if there is anything we missed. I am stoked you already have Query Monitor installed.

    Would it be possible to get access to your staging server where you had disabled all plugins and switched themes ? Perhaps you could create a new admin account for us and share the password here. From there I would like to inspect Query Monitor’s output on Month View to see if there is anything unique about your environment that we could optimize for. If this is acceptable to you please indicate so below and share the login information in a private reply. Do note that we are not allowed to change any settings, only login and view what is happening. Thus I was hoping you could double check that you are using a default theme like Twenty Fifteen, and only have the following three plugins active: Events Calendar Pro, The Events Calendar, and Query Monitor. No worries at all though if this is not something you want to do.

    SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, tribe_event_start_date.meta_value as EventStartDate, tribe_event_end_date.meta_value as EventEndDate
    FROM wp_posts
    LEFT JOIN wp_postmeta as tribe_event_end_date
    ON ( wp_posts.ID = tribe_event_end_date.post_id
    AND tribe_event_end_date.meta_key = ‘_EventEndDate’ )
    LEFT JOIN wp_postmeta AS tribe_event_start_date
    ON wp_posts.ID = tribe_event_start_date.post_id
    AND tribe_event_start_date.meta_key = ‘_EventStartDate’
    WHERE 1=1
    AND wp_posts.post_type = ‘tribe_events’
    AND (wp_posts.post_status = ‘publish’
    OR wp_posts.post_status = ‘acf-disabled’
    OR wp_posts.post_status = ‘future’
    OR wp_posts.post_status = ‘draft’
    OR wp_posts.post_status = ‘pending’
    OR wp_posts.post_status = ‘private’)
    ORDER BY tribe_event_end_date.meta_value DESC, tribe_event_start_date.meta_value DESC, wp_posts.post_date DESC
    LIMIT 0, 100 /* From [intercambio.org/wp-admin/edit.php?post_type=tribe_events&orderby=end-date&order=desc&ids=3387%2C2513%2C2512%2C2492%2C2456%2C1136%2C1229%2C1226%2C2457%2C2455%2C1132%2C1134%2C2317%2C1807%2C2250%2C2249%2C2248%2C2458%2C2298%2C1769%2C1773%2C1801%2C1227%2C2244%2C1222%2C1104%2C1133%2C1802%2C1735%2C1805%2C1112%2C1728%2C1111%2C1233%2C1127%2C1684%2C1683%2C1671%2C1232%2C1125%2C1014%2C1122%2C1121%2C1124] in [N/A] */

    The specific query you shared is indeed a slow one. It is also run  by the WordPress admin itself, not our plugin. And thus not something we have much control over. 🙁 If WordPress core ever started caching those values you would see some significant speedups on all WP edit pages including ours. The only way we could speed that query up currently is by telling WordPress to sort by publish date instead of the event date, and that is not something most of our users want.

    Thanks again for reaching out. We take performance very seriously and it is grand to get more feedback and data from users with a lot of events. I am happy you are running WP Engine. We have many customers on their platform, including some with many more events than you.

    Cheers!

    – Brook

    #1134796
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Slow Database Query – Slow WordPress Dashboard’ is closed to new replies.