Slow Query Problem
-
I’m getting lots of server errors. I’ve looked at the error logs and it appears that there are many queries that are slow and causing timeouts.
How can I fix?
Here are some examples:
Slow mysql_query() call was running query:\n\r\n\t\t\tSELECT SQL_CALC_FOUND_ROWS * FROM wp_em_events\r\n\t\t\tLEFT JOIN wp_em_locations ON wp_em_locations.location_id=wp_em_events.location_id\r\n\t\t\t WHERE (
recurrence!=1 OR
recurrenceIS NULL) AND (
event_status=1) AND (
event_private=0)\r\n\t\t\tGROUP BY wp_em_events.post_id ORDER BY event_start_date DESC, event_start_time DESC, event_name DESC\r\n\t\t\tLIMIT 1 OFFSET 0\r\n\t\t /*
=====
Stopwatch php.pod-1707.function.mysql_query.duration exceeded 1000ms. Was: 4289ms.\n#0 wpe\\measure\\LoggingStopwatch->logStackTrace(4289) called at [/nas/wp/www/common/production/measure.php:198]\n#1 wpe\\measure\\LoggingStopwatch->lap_ended(4289) called at [/nas/wp/www/common/production/measure.php:134]\n#2 wpe\\measure\\Stopwatch->lapstart() called at [/nas/wp/www/common/production/measure.php:152]\n#3 wpe\\measure\\Stopwatch->stop() called at [/nas/wp/www/common/production/statsd_monitoring.php(256) : runkit created function:19]\n#4 mysql_query(\r\n\t\t\tSELECT SQL_CALC_FOUND_ROWS * FROM wp_em_events\r\n\t\t\tLEFT JOIN wp_em_locations ON wp_em_locations.location_id=wp_em_events.location_id\r\n\t\t\t WHERE (
recurrence
!=1 ORrecurrence
IS NULL) AND (event_status
=1) AND (event_private
=0)\r\n\t\t\tGROUP BY wp_em_events.post_id ORDER BY event_start_date DESC, event_start_time DESC, event_name DESC\r\n\t\t\tLIMIT 1 OFFSET 0\r\n\t\t /* From [calendar.powwows.com/events-2/] in [/nas/wp/www/cluster-1707/pwcalendar/wp-content/plugins/events-manager/classes/em-events.php:90] */, Resource id #31) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-includes/wp-db.php:1663]\n#5 wpdb->_do_query(\r\n\t\t\tSELECT SQL_CALC_FOUND_ROWS * FROM wp_em_events\r\n\t\t\tLEFT JOIN wp_em_locations ON wp_em_locations.location_id=wp_em_events.location_id\r\n\t\t\t WHERE (recurrence
!=1 ORrecurrence
IS NULL) AND (event_status
=1) AND (event_private
=0)\r\n\t\t\tGROUP BY wp_em_events.post_id ORDER BY event_start_date DESC, event_start_time DESC, event_name DESC\r\n\t\t\tLIMIT 1 OFFSET 0\r\n\t\t /* From [calendar.powwows.com/events-2/] in [/nas/wp/www/cluster-1707/pwcalendar/wp-content/plugins/events-manager/classes/em-events.php:90] */) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-includes/wp-db.php:1567]\n#6 wpdb->query(\r\n\t\t\tSELECT SQL_CALC_FOUND_ROWS * FROM wp_em_events\r\n\t\t\tLEFT JOIN wp_em_locations ON wp_em_locations.location_id=wp_em_events.location_id\r\n\t\t\t WHERE (recurrence
!=1 ORrecurrence
IS NULL) AND (event_status
=1) AND (event_private
=0)\r\n\t\t\tGROUP BY wp_em_events.post_id ORDER BY event_start_date DESC, event_start_time DESC, event_name DESC\r\n\t\t\tLIMIT 1 OFFSET 0\r\n\t\t) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-content/plugins/events-manager/classes/em-events.php:90]\n#7 EM_Events::get(Array ([limit] => ,[scope] => all,[order] => DESC,[orderby] => Array ([0] => event_start_date,[1] => event_start_time,[2] => event_name),[format] => ,[category] => 0,[tag] => 0,[location] => ,[event] => ,[offset] => ,[page] => ,[recurrence] => 0,[recurrences] => ,[recurring] => ,[month] => ,[year] => ,[pagination] => 1,[array] => ,[owner] => ,[rsvp] => ,[bookings] => ,[search] => ,[geo] => ,[near] => ,[near_unit] => mi,[near_distance] => 25,[ajax] => ,[status] => 1,[format_header] => ,[format_footer] => ,[town] => ,[state] => ,[country] => ,[region] => ,[blog] => 1,[private] => ,[private_only] => ,[post_id] => ), 1) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-content/plugins/events-manager/classes/em-events.php:130]\n#8 EM_Events::count(Array ([limit] => ,[scope] => all,[order] => DESC,[orderby] => Array ([0] => event_start_date,[1] => event_start_time,[2] => event_name),[format] => ,[category] => 0,[tag] => 0,[location] => ,[event] => ,[offset] => ,[page] => ,[recurrence] => 0,[recurrences] => ,[recurring] => ,[month] => ,[year] => ,[pagination] => 1,[array] => ,[owner] => ,[rsvp] => ,[bookings] => ,[search] => ,[geo] => ,[near] => ,[near_unit] => mi,[near_distance] => 25,[ajax] => ,[status] => 1,[format_header] => ,[format_footer] => ,[town] => ,[state] => ,[country] => ,[region] => ,[blog] => 1,[private] => ,[private_only] => ,[post_id] => )) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-content/plugins/events-manager/classes/em-events.php:190]\n#9 EM_Events::output(Array ([owner] => ,[pagination] => 1,[ajax] => ,[orderby] => event_start_date,event_start_time,event_name,[order] => DESC,[scope] => all,[limit] => 20,[page] => 1)) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-content/themes/Calendar 2014/plugins/events-manager/templates/events-list.php:43]\n#10 include(/nas/wp/www/cluster-1707/pwcalendar/wp-content/themes/Calendar 2014/plugins/events-manager/templates/events-list.php) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-content/plugins/events-manager/events-manager.php:642]\n#11 em_locate_template(templates/events-list.php, 1, Array ([args] => Array ([owner] => ,[pagination] => 1,[ajax] => ,[orderby] => event_start_date,event_start_time,event_name,[order] => DESC,[scope] => all,[limit] => 20))) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-content/plugins/events-manager/em-events.php:64]\n#12 em_content()\n#13 call_user_func_array(em_content, Array ([0] => )) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-includes/plugin.php:213]\n#14 apply_filters(the_content, ) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-includes/post-template.php:221]\n#15 the_content(<p>Read the rest of this page »</p>) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-content/themes/Calendar 2014/page_r.php:170]\n#16 include(/nas/wp/www/cluster-1707/pwcalendar/wp-content/themes/Calendar 2014/page_r.php) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-includes/template-loader.php:74]\n#17 require_once(/nas/wp/www/cluster-1707/pwcalendar/wp-includes/template-loader.php) called at [/nas/wp/www/cluster-1707/pwcalendar/wp-blog-header.php:16]\n#18 require(/nas/wp/www/cluster-1707/pwcalendar/wp-blog-header.php) called at [/nas/wp/www/cluster-1707/pwcalendar/index.php:17]\n
- The topic ‘Slow Query Problem’ is closed to new replies.