{"id":1145938,"date":"2016-07-31T12:07:21","date_gmt":"2016-07-31T19:07:21","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/"},"modified":"2016-07-31T12:07:21","modified_gmt":"2016-07-31T19:07:21","slug":"very-slow-queries-makes-wp-admin-unusable","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/","title":{"rendered":"Very slow queries, makes wp-admin unusable"},"content":{"rendered":"<p>We had lots of performance issues with our site and just found out that this plugin was causing it. I disabled both plugins (normal + PRO version) and now everything is back to normal. We&#8217;re on a high performance hosting cluster, so its not a capacity or shared hosting issue. <\/p>\n<p><em>Both W3 Total cache and &#8220;Enable the Month View Cache&#8221; were active.<br \/>\nAccording to phpmyadmin we have almost 80.000 &#8216;tribe_events&#8217; in the wp_posts table. Some days have a few events, some days up to 20 or so.<\/em><\/p>\n<p>We&#8217;re getting slow queries &#8211; even over 20 seconds &#8211; on queries like this one (from our Slow Query Logger):<\/p>\n<pre><code>\nSELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, MIN(wp_postmeta.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate FROM wp_posts  LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )  LEFT JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id )  LEFT JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id AND mt2.meta_key = &quot;_EventHideFromUpcoming&quot; ) 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 = &quot;_EventEndDate&quot; )  WHERE 1=1  AND wp_posts.ID NOT IN (10626) AND ( \n  wp_postmeta.meta_key = &quot;_EventStartDate&quot; \n  AND \n   (\n\t\t\t\t\t( mt1.meta_key = &quot;_EventStartDate&quot; AND CAST(mt1.meta_value AS DATETIME) &lt; &quot;2017-08-19 20:00:00&quot; )\n\t\t\t\t\tOR (\n\t\t\t\t\t\t( mt1.meta_key = &quot;_EventStartDate&quot; AND CAST(mt1.meta_value AS DATETIME) = &quot;2017-08-19 20:00:00&quot; )\n\t\t\t\t\t\tAND mt1.post_id &lt; 10626\n\t\t\t\t\t)\n\t\t\t\t)  \n  AND \n  mt2.post_id IS NULL\n) AND wp_posts.post_type = &quot;tribe_events&quot; AND (wp_posts.post_status = &quot;publish&quot;)  GROUP BY wp_posts.ID ORDER BY EventStartDate DESC, wp_posts.ID DESC LIMIT 0, 1;\n<\/code><\/pre>\n<p><strong>Our system:<\/strong><br \/>\nPHP7<br \/>\nWP 4.5.3<br \/>\nThe Events Calendar 4.2.3<br \/>\nThe Events Calendar Pro 4.2.3<\/p>\n<p><strong>Main question:<\/strong><br \/>\nHow can we improve the performance and get rid of the slow queries? Are we having too many events? And if so, what is too many?<\/p>\n<p><em>Also, I backupped everything before deactivating the plugins (by renaming plugin folder in ftp, and Pro version deactivated in admin next) I assume this keeps all event data in place, right? <\/em><\/p>\n<p>Thanks in advance!<\/p>\n","protected":false},"template":"","class_list":["post-1145938","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Very slow queries, makes wp-admin unusable -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Very slow queries, makes wp-admin unusable -\" \/>\n<meta property=\"og:description\" content=\"We had lots of performance issues with our site and just found out that this plugin was causing it. I disabled both plugins (normal + PRO version) and now everything is back to normal. We&#8217;re on a high performance hosting cluster, so its not a capacity or shared hosting issue. Both W3 Total cache and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/\",\"name\":\"Very slow queries, makes wp-admin unusable -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-07-31T19:07:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Very slow queries, makes wp-admin unusable\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Very slow queries, makes wp-admin unusable -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/","og_locale":"en_US","og_type":"article","og_title":"Very slow queries, makes wp-admin unusable -","og_description":"We had lots of performance issues with our site and just found out that this plugin was causing it. I disabled both plugins (normal + PRO version) and now everything is back to normal. We&#8217;re on a high performance hosting cluster, so its not a capacity or shared hosting issue. Both W3 Total cache and [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/","name":"Very slow queries, makes wp-admin unusable -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-07-31T19:07:21+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/very-slow-queries-makes-wp-admin-unusable\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Very slow queries, makes wp-admin unusable"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1145938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1145938\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1145938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}