{"id":62314,"date":"2013-08-21T12:39:36","date_gmt":"2013-08-21T19:39:36","guid":{"rendered":"https:\/\/tri.be\/support\/forums\/topic\/monster-query-flooding-our-database\/"},"modified":"2013-08-21T12:39:36","modified_gmt":"2013-08-21T19:39:36","slug":"monster-query-flooding-our-database","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/","title":{"rendered":"Monster Query flooding our database"},"content":{"rendered":"<p>This query being executed over and over brought down our database, can someone tell me what this query is all about?<\/p>\n<p>SELECT DISTINCT wp_posts.*, wp_postmeta.meta_value as EventStartDate, IF(tribe_event_duration.meta_value IS NULL, tribe_event_end_date.meta_value, DATE_ADD(CAST(wp_postmeta.meta_value AS DATETIME), INTERVAL tribe_event_duration.meta_value SECOND)) as EventEndDate, tribe_event_duration.meta_value as EventDuration FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) AND wp_postmeta.meta_key = &#8216;_EventStartDate&#8217; 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 = &#8216;_EventEndDate&#8217; ) LEFT JOIN wp_postmeta as tribe_event_duration ON ( wp_posts.ID = tribe_event_duration.post_id AND tribe_event_duration.meta_key = &#8216;_EventDuration&#8217; ) WHERE 1=1 AND wp_posts.ID NOT IN (241125,241135,241159,241166,241428,241432,241453,241459,241491,241493,241495,241497,241500,241503,241505,241507,241509,241511,241513,241515,241517,241519,241521,241523,241525,241527,241529,241531,241533,241536,241539,241541,241543,241545,241547,241549,241551,241553,241555,241557,241562,241564,241566,241568,241570,241572,241576,241578,241580,241582,241584,241586,241588,241590,241592,241594,241596,241600,241605,241610,241613,241615,241617,241619,241621,241623,241625,241627,241629,241631,241633,241635,241637,241640,241642,241644,241646,241648,241650,241652,241654,241656,241658,241660,241662,241666,241668,241670,241672,241674,241678,241680,241684,241690,241692,241694,241696,241698,241700,241702,241704,241706,241708,241710,241712,241714,241716,241718,241720,241722,241724,241726,241728,241730,241732,241734,241737,241739,241741,241743,241747,241750,241752,241754,241756,241758,241760,241762,241764,241766,241768,241770,241772,241774,241776,241778,241780,241782,241784,241786,241788,241792,241794,241796,241798,241800,241802,241804,241807,241809,241811,241813,241815,241819,241821,241823,241825,241827,241829,241831,241834,241836,241838,241840,241842,241844,241847,241849,241851,241853,241855,241857,241860,241862,241865,241867,241869,241871,241874,241876,241878,241881,241885,241889,241893,241895,241898,241901,241905,241907,241909,241911,241914,241916,241920,241922,241925,241927,241929,241932,241934,241936,241939,241943,241945,241947,241950,241952,241956,241958,241960,241964,241968,241970,241973,241975,241979,241981,241984,241986,241988,241990,241992,241994,241996,241998,242000,242002,242005,242008,242013,242016,242018,242020,242022,242024,242027,242029,242031,242033,242037,242039,242042,242044,242048,242050,242052,242054,242058,242060,242064,242067,242071,242073,242075,242077,242079,242081,242084,242086,242089,242093,242096,242099,242103,242107,242109,242111,242113,242115,242117,242119,242121,242123,242125,242127,242129,242133,242136,242138,242140,242142,242144,242146,242148,242150,242154,242156,242158,242160,242162,242164,242166,242168,242170,242172,242174,242176,242178,242180,242182,242184,242186,242188,242190,242196,242198,242200,242202,242205,242209,242211,242213,242216,242218,242222,242225,242227,242229,242231,242235,242237,242241,242243,242246,242249,242251,242253,242255,242257,242261,242263,242265,242267,242269,242271,242273,242275,242277,242279,242281,242283,242285,242287,242289,242291,242295,242297,242299,242301,242304,242306,242308,242310,242312,242314,242316,242318,242322,242324,242335,242338,242341,242343,242345,242347,242349,242351,242353,242358,242360,242362,242364,242366,242368,242370,242372,242375,242377,242379,242381,242383,242385,242387,242389,242391,242393,242395,242400,242402,242405,242408,242410,242412,242414,242416,242418,242420,242422,242424,242426,242438,242440,242442,242445,242447,242449,242451,242454,242456,242458,242461,242463,242465,242467,242469,242476,242479,242481,242486,242488,242490,242493,242496,242498,242501,242503,242505,242507,242509,242511,242513,242515,242517,242519,242521,242523,242525,242532,242534,242536,242539,242541,242543,242545,242553,242555,242557,242559,242561,242563,242567,242569,242571,242573,242575,242577,242579,242581,242583,242586,242591,242593,242595,242597,242601,242606,242611,242613,242615,242617,242619,242622,242624,242626,242628,242630,242632,242634,242636,242638,242640,242642,242644,242647,242649,242652,242655,242657,242659,242661,242663,242665,242674,242676,242678,242682,242684,242686,242689,242691,242700,242702,242704,242706,242710,242712,242714,242717,242719,242721,242723,242728,242738,242740,242742,242744,242746,242748,242750,242763,242765,242767,242769,242782,242784,242787,242789,242791,242799,242802,242804,242806,242808,242812,242867,242869,242871,242875,242877,242879,242884) AND wp_posts.post_type = &#8216;tribe_events&#8217; AND (wp_posts.post_status = &#8216;publish&#8217;) AND (wp_postmeta.meta_key = &#8216;_EventStartDate&#8217; ) AND ((wp_postmeta.meta_value &gt;= &#8216;2013-08-15 00:00:00&#8217; AND wp_postmeta.meta_value = &#8216;2013-08-15 00:00:00&#8217; AND wp_postmeta.meta_value &lt;= &#039;2013-08-15 23:59:59&#039; ) OR (wp_postmeta.meta_value = &#8216;2013-08-15 23:59:59&#8217; )) ORDER BY wp_posts.menu_order ASC, DATE(wp_postmeta.meta_value) ASC, TIME(wp_postmeta.meta_value) ASC LIMIT 0, 3<\/p>\n","protected":false},"template":"","class_list":["post-62314","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>Monster Query flooding our database -<\/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\/monster-query-flooding-our-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Monster Query flooding our database -\" \/>\n<meta property=\"og:description\" content=\"This query being executed over and over brought down our database, can someone tell me what this query is all about? SELECT DISTINCT wp_posts.*, wp_postmeta.meta_value as EventStartDate, IF(tribe_event_duration.meta_value IS NULL, tribe_event_end_date.meta_value, DATE_ADD(CAST(wp_postmeta.meta_value AS DATETIME), INTERVAL tribe_event_duration.meta_value SECOND)) as EventEndDate, tribe_event_duration.meta_value as EventDuration FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) AND wp_postmeta.meta_key = &#8216;_EventStartDate&#8217; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/\",\"name\":\"Monster Query flooding our database -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2013-08-21T19:39:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/#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\":\"Monster Query flooding our database\"}]},{\"@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":"Monster Query flooding our database -","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\/monster-query-flooding-our-database\/","og_locale":"en_US","og_type":"article","og_title":"Monster Query flooding our database -","og_description":"This query being executed over and over brought down our database, can someone tell me what this query is all about? SELECT DISTINCT wp_posts.*, wp_postmeta.meta_value as EventStartDate, IF(tribe_event_duration.meta_value IS NULL, tribe_event_end_date.meta_value, DATE_ADD(CAST(wp_postmeta.meta_value AS DATETIME), INTERVAL tribe_event_duration.meta_value SECOND)) as EventEndDate, tribe_event_duration.meta_value as EventDuration FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) AND wp_postmeta.meta_key = &#8216;_EventStartDate&#8217; [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/","name":"Monster Query flooding our database -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2013-08-21T19:39:36+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/monster-query-flooding-our-database\/#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":"Monster Query flooding our database"}]},{"@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\/62314","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\/62314\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=62314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}