Long Queries - WP Engine - Error 502
I have used
WP Engine for almost a year, and Appthemes always worked fine.
But since a few months/weeks ago my log ERRORs shows too many LONG QUERIES from App themes: JobRoller, Vantage, Classipress. It is shutting down my website (Error 502 from server).
WPEngine asked me to discuss with developers to optimize the code.
What can I do? Are there other customers with the same problem?
Do you recommend to use another WebServer?
Here are some SQL examples:
[Fri Jun 27 14:39:49 2014] [error] [client 191.247.224.8] LONG QUERY (1543 characters long generated in /nas/
wp/www/cluster-1514/empregos/
wp-content/themes/jobroller/includes/theme-geolocation.php:296): SELECT post_id FROM ( \n\t\t\t\t\t\t\tSELECT post_id, ( 6371 * acos( cos( radians(-23.000371) ) * cos( radians(lat) ) * cos( radians(lng) - radians(-43.365895) ) + sin( radians(-23.000371) ) * sin( radians(lat) ) ) ) AS distance, post_date \n\t\t\t\t\t\t\tFROM ( \n\t\t\t\t\t\tSELECT latitude.post_id, lat, lng, latitude.post_date FROM\n\t\t\t\t\t\t\t( SELECT post_id, meta_value lat, post_date\n\t\t\t\t\t\t\t\tFROM wp_posts \n\t\t\t\t\t\t\t\tLEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id \n\t\t\t\t\t\t\t\tWHERE meta_key = '_jr_geo_latitude' AND wp_posts.post_status = 'publish'\n\t\t\t\t\t\t\t) latitude, \n\t\t\t\t\t\t\t( SELECT post_id, meta_value lng, post_date\n\t\t\t\t\t\t\t\tFROM wp_posts \n\t\t\t\t\t\t\t\tLEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id \n\t\t\t\t\t\t\t\tWHERE meta_key = '_jr_geo_longitude' AND wp_posts.post_status = 'publish'\n\t\t\t\t\t\t\t) longitude\n\t\t\t\t\t\tWHERE latitude.post_id = longitude.post_id\n\t\t\t\t\t\tAND latitude.post_id IN ( SELECT wp_postmeta.post_id FROM wp_postmeta WHERE meta_key = 'geo_short_address' AND meta_value <> '') \n\t\t\t\t\t\t ) as geo_data \n\t\t\t\t\t\t\tHAVING distance < 1 \n\t\t\t\t\t\t\tUNION ( \n\t\t\t\t\tSELECT ID, 999999999 as distance, post_date FROM wp_posts\n\t\t\t\t\tWHERE \n\t\t\t\t\t( \n\t\t\t\t\t\tID NOT IN( SELECT wp_postmeta.post_id FROM wp_postmeta WHERE meta_key = 'geo_short_address' ) \n\t\t\t\t\t\tOR ID IN ( SELECT wp_postmeta.post_id FROM wp_postmeta WHERE meta_key = 'geo_short_address' AND meta_value = '' ) \n\t\t\t\t\t)\n\t\t\t\t\tAND wp_posts.post_status = 'publish' AND post_type = 'job_listing'\n\t\t\t\t\tORDER BY post_date DESC )\n\t\t\t\t\t\t\tORDER BY COALESCE(distance, 999999999) ASC, post_date DESC ) as jobs, referer:
http://carreirabeauty.com/empregos/
[Fri Jun 27 14:41:13 2014] [error] [client 179.239.3.107] LONG QUERY (6065 characters long generated in /nas/
wp/www/cluster-1514/empregos/index.php:17): SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id WHERE 1=1 AND (((wp_posts.post_title LIKE '%quero%') OR (wp_posts.post_content LIKE '%quero%') OR ((wp_postmeta.meta_key = '_Company') AND (wp_postmeta.meta_value LIKE '%quero%')) OR ((wp_postmeta.meta_key = 'geo_address') AND (wp_postmeta.meta_value LIKE '%quero%')) OR ((wp_postmeta.meta_key = '_CompanyURL') AND (wp_postmeta.meta_value LIKE '%quero%')) OR ((wp_postmeta.meta_key = 'geo_short_address') AND (wp_postmeta.meta_value LIKE '%quero%')) OR ((wp_postmeta.meta_key = 'geo_country') AND (wp_postmeta.meta_value LIKE '%quero%')) OR ((wp_postmeta.meta_key = 'geo_short_address_country') AND (wp_postmeta.meta_value LIKE '%quero%'))) AND ((wp_posts.post_title LIKE '%comprar%') OR (wp_posts.post_content LIKE '%comprar%') OR ((wp_postmeta.meta_key = '_Company') AND (wp_postmeta.meta_value LIKE '%comprar%')) OR ((wp_postmeta.meta_key = 'geo_address') AND (wp_postmeta.meta_value LIKE '%comprar%')) OR ((wp_postmeta.meta_key = '_CompanyURL') AND (wp_postmeta.meta_value LIKE '%comprar%')) OR ((wp_postmeta.meta_key = 'geo_short_address') AND (wp_postmeta.meta_value LIKE '%comprar%')) OR ((wp_postmeta.meta_key = 'geo_country') AND (wp_postmeta.meta_value LIKE '%comprar%')) OR ((wp_postmeta.meta_key = 'geo_short_address_country') AND (wp_postmeta.meta_value LIKE '%comprar%'))) AND ((wp_posts.post_title LIKE '%apalhelho%') OR (wp_posts.post_content LIKE '%apalhelho%') OR ((wp_postmeta.meta_key = '_Company') AND (wp_postmeta.meta_value LIKE '%apalhelho%')) OR ((wp_postmeta.meta_key = 'geo_address') AND (wp_postmeta.meta_value LIKE '%apalhelho%')) OR ((wp_postmeta.meta_key = '_CompanyURL') AND (wp_postmeta.meta_value LIKE '%apalhelho%')) OR ((wp_postmeta.meta_key = 'geo_short_address') AND (wp_postmeta.meta_value LIKE '%apalhelho%')) OR ((wp_postmeta.meta_key = 'geo_country') AND (wp_postmeta.meta_value LIKE '%apalhelho%')) OR ((wp_postmeta.meta_key = 'geo_short_address_country') AND (wp_postmeta.meta_value LIKE '%apalhelho%'))) AND ((wp_posts.post_title LIKE '%de%') OR (wp_posts.post_content LIKE '%de%') OR ((wp_postmeta.meta_key = '_Company') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = 'geo_address') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = '_CompanyURL') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = 'geo_short_address') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = 'geo_country') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = 'geo_short_address_country') AND (wp_postmeta.meta_value LIKE '%de%'))) AND ((wp_posts.post_title LIKE '%salao%') OR (wp_posts.post_content LIKE '%salao%') OR ((wp_postmeta.meta_key = '_Company') AND (wp_postmeta.meta_value LIKE '%salao%')) OR ((wp_postmeta.meta_key = 'geo_address') AND (wp_postmeta.meta_value LIKE '%salao%')) OR ((wp_postmeta.meta_key = '_CompanyURL') AND (wp_postmeta.meta_value LIKE '%salao%')) OR ((wp_postmeta.meta_key = 'geo_short_address') AND (wp_postmeta.meta_value LIKE '%salao%')) OR ((wp_postmeta.meta_key = 'geo_country') AND (wp_postmeta.meta_value LIKE '%salao%')) OR ((wp_postmeta.meta_key = 'geo_short_address_country') AND (wp_postmeta.meta_value LIKE '%salao%'))) AND ((wp_posts.post_title LIKE '%de%') OR (wp_posts.post_content LIKE '%de%') OR ((wp_postmeta.meta_key = '_Company') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = 'geo_address') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = '_CompanyURL') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = 'geo_short_address') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = 'geo_country') AND (wp_postmeta.meta_value LIKE '%de%')) OR ((wp_postmeta.meta_key = 'geo_short_address_country') AND (wp_postmeta.meta_value LIKE '%de%'))) AND ((wp_posts.post_title LIKE '%beleza%') OR (wp_posts.post_content LIKE '%beleza%') OR ((wp_postmeta.meta_key = '_Company') AND (wp_postmeta.meta_value LIKE '%beleza%')) OR ((wp_postmeta.meta_key = 'geo_address') AND (wp_postmeta.meta_value LIKE '%beleza%')) OR ((wp_postmeta.meta_key = '_CompanyURL') AND (wp_postmeta.meta_value LIKE '%beleza%')) OR ((wp_postmeta.meta_key = 'geo_short_address') AND (wp_postmeta.meta_value LIKE '%beleza%')) OR ((wp_postmeta.meta_key = 'geo_country') AND (wp_postmeta.meta_value LIKE '%beleza%')) OR ((wp_postmeta.meta_key = 'geo_short_address_country') AND (wp_postmeta.meta_value LIKE '%beleza%'))) AND ((wp_posts.post_title LIKE '%usado%') OR (wp_posts.post_content LIKE '%usado%') OR ((wp_postmeta.meta_key = '_Company') AND (wp_postmeta.meta_value LIKE '%usado%')) OR ((wp_postmeta.meta_key = 'geo_address') AND (wp_postmeta.meta_value LIKE '%usado%')) OR ((wp_postmeta.meta_key = '_CompanyURL') AND (wp_postmeta.meta_value LIKE '%usado%')) OR ((wp_postmeta.meta_key = 'geo_short_address') AND (wp_postmeta.meta_value LIKE '%usado%')) OR ((wp_postmeta.meta_key = 'geo_country') AND (wp_postmeta.meta_value LIKE '%usado%')) OR ((wp_postmeta.meta_key = 'geo_short_address_country') AND (wp_postmeta.meta_value LIKE '%usado%')))) AND (wp_posts.post_status = 'publish') AND (wp_posts.post_type = 'job_listing') GROUP BY wp_posts.ID ORDER BY (CASE WHEN wp_posts.post_title LIKE '%quero comprar apalhelho de salao de beleza usado%' THEN 1 WHEN wp_posts.post_title LIKE '%quero%' AND wp_posts.post_title LIKE '%comprar%' AND wp_posts.post_title LIKE '%apalhelho%' AND wp_posts.post_title LIKE '%salao%' AND wp_posts.post_title LIKE '%beleza%' AND wp_posts.post_title LIKE '%usado%' THEN 2 WHEN wp_posts.post_title LIKE '%quero%' OR wp_posts.post_title LIKE '%comprar%' OR wp_posts.post_title LIKE '%apalhelho%' OR wp_posts.post_title LIKE '%salao%' OR wp_posts.post_title LIKE '%beleza%' OR wp_posts.post_title LIKE '%usado%' THEN 3 WHEN wp_posts.post_content LIKE '%quero comprar apalhelho de salao de beleza usado%' THEN 4 ELSE 5 END), wp_posts.post_date DESC LIMIT 0, 20, referer:
http://carreirabeauty.com/busca/?q=c...iro+e+manicure