{"id":1280146,"date":"2017-05-08T03:05:18","date_gmt":"2017-05-08T10:05:18","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/"},"modified":"2017-05-10T07:52:59","modified_gmt":"2017-05-10T14:52:59","slug":"urgent-production-issue-long-running-query","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/","title":{"rendered":"Urgent &#8211; Production issue &#8211; Long running query"},"content":{"rendered":"<p>Good Day from Germany,<\/p>\n<p>we had already several times issues with long running queries on our hosting environment. Every few weeks we come in a situation where certain queries are extremely long running and block the entire website, so that you can neither reach the backend nor work in the frontend.<\/p>\n<p>Today we could identify a query together with our hosting provider. Attached you find the complete command. Finally we killed the process and the lock situation was solved.<\/p>\n<p>Pls help urgently.<\/p>\n<p>Best regards<br \/>\nUwe<\/p>\n<p>P.S. because I cannot upload text file you see the code here:<\/p>\n<p>SELECT SQL_CALC_FOUND_ROWS * FROM ( SELECT DISTINCT apgYs_posts.*, apgYs_postmeta.meta_value as EventStartDate, tribe_event_end_date.meta_value as EventEndDate FROM apgYs_posts LEFT JOIN apgYs_term_relationships ON (apgYs_posts.ID = apgYs_term_relationships.object_id) LEFT JOIN apgYs_term_relationships AS tt1 ON (apgYs_posts.ID = tt1.object_id) INNER JOIN apgYs_postmeta ON ( apgYs_posts.ID = apgYs_postmeta.post_id ) INNER JOIN apgYs_postmeta AS mt1 ON ( apgYs_posts.ID = mt1.post_id ) INNER JOIN apgYs_postmeta AS mt2 ON ( apgYs_posts.ID = mt2.post_id ) INNER JOIN apgYs_postmeta AS mt3 ON ( apgYs_posts.ID = mt3.post_id ) INNER JOIN apgYs_postmeta AS mt4 ON ( apgYs_posts.ID = mt4.post_id ) INNER JOIN apgYs_postmeta AS mt5 ON ( apgYs_posts.ID = mt5.post_id ) INNER JOIN apgYs_postmeta AS mt6 ON ( apgYs_posts.ID = mt6.post_id ) LEFT JOIN apgYs_postmeta as tribe_event_end_date ON ( apgYs_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = &#8216;_EventEndDate&#8217; ) LEFT JOIN apgYs_postmeta AS cost_filter ON (apgYs_posts.ID = cost_filter.post_id)LEFT JOIN apgYs_postmeta AS venue_filter ON (apgYs_posts.ID = venue_filter.post_id AND venue_filter.meta_key = &#8216;_EventVenueID&#8217;)LEFT JOIN apgYs_postmeta AS organizer_filter ON (apgYs_posts.ID = organizer_filter.post_id AND organizer_filter.meta_key = &#8216;_EventOrganizerID&#8217;)LEFT JOIN apgYs_postmeta AS city_filter ON (apgYs_posts.ID = city_filter.post_id AND city_filter.meta_key = &#8216;_EventVenueID&#8217;) WHERE 1=1 AND ( ( apgYs_term_relationships.term_taxonomy_id IN (145) ) AND tt1.term_taxonomy_id IN (5) ) AND ( apgYs_postmeta.meta_key = &#8216;_EventStartDate&#8217; AND ( mt1.meta_key = &#8216;_EventVenueID&#8217; AND CAST(mt1.meta_value AS SIGNED) IN (&#8216;3039&#8242;,&#8217;3142&#8242;,&#8217;3348&#8242;,&#8217;3353&#8242;,&#8217;5195&#8242;,&#8217;5334&#8217;) ) AND ( ( mt2.meta_key = &#8216;_ecp_custom_2&#8217; AND mt2.meta_value IN (&#8216;Sonia Schadwinkel&#8217;) ) AND ( mt3.meta_key = &#8216;__ecp_custom_10&#8217; AND mt3.meta_value = &#8216;Einsteiger&#8217; ) AND ( mt4.meta_key = &#8216;__ecp_custom_11&#8217; AND mt4.meta_value = &#8216;Mischtechnik&#8217; ) AND ( mt5.meta_key = &#8216;__ecp_custom_11&#8217; AND mt5.meta_value = &#8216;Acryl&#8217; ) AND ( mt6.meta_key = &#8216;__ecp_custom_51&#8217; AND mt6.meta_value = &#8216;Farbe\/Komposition&#8217; ) ) ) AND apgYs_posts.post_type = &#8216;tribe_events&#8217; AND ((apgYs_posts.post_status = &#8216;publish&#8217;)) AND tribe_event_end_date.meta_value &lt; &#8216;2017-05-08 23:59:59&#8217; AND (( cost_filter.meta_key = &#8216;_EventCost&#8217; AND cost_filter.meta_value &gt;= 109 AND cost_filter.meta_value IS NOT NULL AND CAST(cost_filter.meta_value AS SIGNED) BETWEEN 109 AND 1295 ) ) AND venue_filter.meta_value IN (5358) AND organizer_filter.meta_value IN (3995) AND city_filter.meta_value IN ( 3204,4410 ) ORDER BY EventStartDate ASC, apgYs_posts.post_date 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-1280146","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 - Production issue - Long running query -<\/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-production-issue-long-running-query\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Urgent - Production issue - Long running query -\" \/>\n<meta property=\"og:description\" content=\"Good Day from Germany, we had already several times issues with long running queries on our hosting environment. Every few weeks we come in a situation where certain queries are extremely long running and block the entire website, so that you can neither reach the backend nor work in the frontend. Today we could identify [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-05-10T14:52:59+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-production-issue-long-running-query\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/\",\"name\":\"Urgent - Production issue - Long running query -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-05-08T10:05:18+00:00\",\"dateModified\":\"2017-05-10T14:52:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/#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 &#8211; Production issue &#8211; Long running query\"}]},{\"@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 - Production issue - Long running query -","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-production-issue-long-running-query\/","og_locale":"en_US","og_type":"article","og_title":"Urgent - Production issue - Long running query -","og_description":"Good Day from Germany, we had already several times issues with long running queries on our hosting environment. Every few weeks we come in a situation where certain queries are extremely long running and block the entire website, so that you can neither reach the backend nor work in the frontend. Today we could identify [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/","article_modified_time":"2017-05-10T14:52:59+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-production-issue-long-running-query\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/","name":"Urgent - Production issue - Long running query -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-05-08T10:05:18+00:00","dateModified":"2017-05-10T14:52:59+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/urgent-production-issue-long-running-query\/#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 &#8211; Production issue &#8211; Long running query"}]},{"@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\/1280146","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\/1280146\/revisions"}],"predecessor-version":[{"id":1281659,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1280146\/revisions\/1281659"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1280146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}