{"id":1004067,"date":"2015-09-10T20:33:23","date_gmt":"2015-09-11T03:33:23","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/"},"modified":"2015-12-10T15:27:58","modified_gmt":"2015-12-10T23:27:58","slug":"urgent-slow-mysql-querie-problems","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/","title":{"rendered":"URGENT: slow mysql querie problems"},"content":{"rendered":"<p>My site host provider (site ground) keeps shutting down site because of slow MySQL queries.<br \/>\nHere&#8217;s part of the message they sent me:<\/p>\n<p>&#8220;With this notification we would like to inform you that our in-house Website Performance Monitoring System (WPMS) has signaled that your account constantly uses a large amount of the server&#8217;s CPU resources. These excessive requests consume an abnormally high amount of CPU resources and endanger the overall performance of the shared server.<\/p>\n<p>Your account consumed more than 55480 CPU seconds for the last 24 hours.<\/p>\n<p>Violated terms of service:<br \/>\nNo more than 40,000 CPU seconds for any given calendar day;&#8221;<\/p>\n<p>Here&#8217;s the code they provided that shows the events calendar pro is the cause of this issue.<br \/>\nWe cannot afford to have this site down.<br \/>\nPLEASE HELP<\/p>\n<p>=== TOP 2 of 2 (total) Slow Queries for the past 24 hours ==========<br \/>\n1. Executed 9h 10m 30s ago for 1.140676 sec on Database &#8211;&gt; ioimprov_db<br \/>\nDate: 2015-09-10 13:58:56 Query_time: 1.140676 Rows_examined: 71004: Rows_sent 1 Lock_time: 0.000337<br \/>\nSELECT SQL_CALC_FOUND_ROWS * FROM ( SELECT DISTINCT wp_4_posts.*, wp_4_postmeta.meta_value as EventStartDate, tribe_event_end_date.meta_value as EventEndDate FROM wp_4_posts LEFT JOIN wp_4_postmeta ON ( wp_4_posts.ID = wp_4_postmeta.post_id ) LEFT JOIN wp_4_postmeta AS mt1 ON ( wp_4_posts.ID = mt1.post_id ) LEFT JOIN wp_4_postmeta AS mt2 ON (wp_4_posts.ID = mt2.post_id AND mt2.meta_key = &#8216;_EventHideFromUpcoming&#8217; ) LEFT JOIN wp_4_postmeta as tribe_event_end_date ON ( wp_4_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = &#8216;_EventEndDate&#8217; ) WHERE 1=1 AND wp_4_posts.ID NOT IN (17988) AND ( wp_4_postmeta.meta_key = &#8216;_EventStartDate&#8217; AND ( mt1.meta_key = &#8216;_EventStartDate&#8217; AND CAST(mt1.meta_value AS DATETIME) &lt; &#8216;2015-09-24 18:30:00&#8217; ) AND mt2.post_id IS NULL ) AND wp_4_posts.post_type = &#8216;tribe_events&#8217; AND (wp_4_posts.post_status = &#8216;publish&#8217;) ORDER BY EventStartDate DESC ) a GROUP BY IF( post_parent = 0, ID, post_parent ) ORDER BY EventStartDate ASC LIMIT 0, 1;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n2. Executed 6h 55m 9s ago for 1.076193 sec on Database &#8211;&gt; ioimprov_db<br \/>\nDate: 2015-09-10 16:14:17 Query_time: 1.076193 Rows_examined: 84285: Rows_sent 1 Lock_time: 0.000397<br \/>\nSELECT SQL_CALC_FOUND_ROWS * FROM ( SELECT DISTINCT wp_2_posts.*, wp_2_postmeta.meta_value as EventStartDate, tribe_event_end_date.meta_value as EventEndDate FROM wp_2_posts LEFT JOIN wp_2_postmeta ON ( wp_2_posts.ID = wp_2_postmeta.post_id ) LEFT JOIN wp_2_postmeta AS mt1 ON ( wp_2_posts.ID = mt1.post_id ) LEFT JOIN wp_2_postmeta AS mt2 ON (wp_2_posts.ID = mt2.post_id AND mt2.meta_key = &#8216;_EventHideFromUpcoming&#8217; ) LEFT JOIN wp_2_postmeta as tribe_event_end_date ON ( wp_2_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = &#8216;_EventEndDate&#8217; ) WHERE 1=1 AND wp_2_posts.ID NOT IN (18358) AND ( wp_2_postmeta.meta_key = &#8216;_EventStartDate&#8217; AND ( mt1.meta_key = &#8216;_EventStartDate&#8217; AND CAST(mt1.meta_value AS DATETIME) &gt; &#8216;2015-09-11 22:30:00&#8217; ) AND mt2.post_id IS NULL ) AND wp_2_posts.post_type = &#8216;tribe_events&#8217; AND (wp_2_posts.post_status = &#8216;publish&#8217;) ORDER BY EventStartDate ASC ) a GROUP BY IF( post_parent = 0, ID, post_parent ) ORDER BY EventStartDate ASC LIMIT 0, 1;<\/p>\n","protected":false},"template":"","class_list":["post-1004067","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>URGENT: slow mysql querie problems -<\/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\/urgent-slow-mysql-querie-problems\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"URGENT: slow mysql querie problems -\" \/>\n<meta property=\"og:description\" content=\"My site host provider (site ground) keeps shutting down site because of slow MySQL queries. Here&#8217;s part of the message they sent me: &#8220;With this notification we would like to inform you that our in-house Website Performance Monitoring System (WPMS) has signaled that your account constantly uses a large amount of the server&#8217;s CPU resources. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-10T23:27:58+00:00\" \/>\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=\"3 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\/urgent-slow-mysql-querie-problems\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/\",\"name\":\"URGENT: slow mysql querie problems -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-09-11T03:33:23+00:00\",\"dateModified\":\"2015-12-10T23:27:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/#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\":\"URGENT: slow mysql querie problems\"}]},{\"@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":"URGENT: slow mysql querie problems -","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\/urgent-slow-mysql-querie-problems\/","og_locale":"en_US","og_type":"article","og_title":"URGENT: slow mysql querie problems -","og_description":"My site host provider (site ground) keeps shutting down site because of slow MySQL queries. Here&#8217;s part of the message they sent me: &#8220;With this notification we would like to inform you that our in-house Website Performance Monitoring System (WPMS) has signaled that your account constantly uses a large amount of the server&#8217;s CPU resources. [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/","article_modified_time":"2015-12-10T23:27:58+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/","name":"URGENT: slow mysql querie problems -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-09-11T03:33:23+00:00","dateModified":"2015-12-10T23:27:58+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-slow-mysql-querie-problems\/#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":"URGENT: slow mysql querie problems"}]},{"@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\/1004067","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1004067\/revisions"}],"predecessor-version":[{"id":1004091,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1004067\/revisions\/1004091"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1004067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}