Slow wordpress queries bringing down all my sites on MediaTemple (gs)
-
I had four wordpress & one vBulletin installed on my Gridserver, recently I have been getting random temporary outages.
At random, a couple of times a week, sometimes less, sometimes more, all my sites will go down and when try and load any of them you get a white page with black text saying:
“Error Establishing Database connection”
Support directed me to the Query Analyzer, it showed that some of my queries were taking over 40 seconds, and this was the problem.
I moved the forum to another host, deleted a ton of plugins, indexed a couple of queries, increased the memory cache to 24 Mb’s, installed the supercache plugin on all the wordpress sites.
And now the problem is happening more and more, before I moved the site etc, it would happen a couple of times a week, now it is happening several times a day.
The Query logs are now showing the query time is down to 4 seconds and MT support are saying this is still the reason for the outages, slow queries. Unfortunately I am totally lost as to how to identify, remove or fix the problem
I would really appreciate some help on figuring out how the hell to stop this happening.
Created 05:05 PM 08/14/2008
### 64 Queries
### Total time: 193, Average time: 3.015625
### Taking 2 to 4 seconds to complete
### Rows analyzed 3327 – 4447
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (’27’, ‘282’, ‘11654’, ‘2587’, ’29’, ’22’, ‘461’, ’30’, ‘11562’, ‘11655’, ‘8643’, ‘5542’, ”)) AND p.ID != 12290 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-15 00:00:00’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 36 Queries
### Total time: 74, Average time: 2.05555555555556
### Taking 2 to 3 seconds to complete
### Rows analyzed 2268 – 4424
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘7986’, ‘7988’, ‘4579’, ‘225’, ‘4580’, ‘197’, ’30’, ‘3911’, ‘269’, ‘7987’, ‘3476’, ”)) AND p.ID != 6444 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 23:01:42’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 19 Queries
### Total time: 40, Average time: 2.10526315789474
### Taking 2 to 3 seconds to complete
### Rows analyzed 6738 – 6756
SELECTID
,post_author
,post_date
,post_date_gmt
,post_status
,post_name
,post_modified
,post_modified_gmt
,post_parent
,post_type
FROMwp_posts
WHERE ( (post_status = ‘XXX’ AND (post_type = ‘XXX’ OR post_type = ‘XXX’)) OR (post_status = ‘XXX’ AND post_type = ‘XXX’) ) AND post_password=’XXX’ ORDER BY post_modified DESC;SELECT
ID
,post_author
,post_date
,post_date_gmt
,post_status
,post_name
,post_modified
,post_modified_gmt
,post_parent
,post_type
FROMwp_posts
WHERE ( (post_status = ‘publish’ AND (post_type = ‘post’ OR post_type = ”)) OR (post_status = ‘publish’ AND post_type = ‘page’) ) AND post_password=” ORDER BY post_modified DESC;### 15 Queries
### Total time: 32, Average time: 2.13333333333333
### Taking 2 to 3 seconds to complete
### Rows analyzed 3206 – 4203
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘4579’, ‘7657’, ‘373’, ‘10220’, ‘365’, ‘225’, ‘197’, ’30’, ‘3476’, ”)) AND p.ID != 10069 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 23:58:56’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 8 Queries
### Total time: 26, Average time: 3.25
### Taking 2 , 3 , 3 , 3 , 3 , 3 , 3 , 6 seconds to complete
### Rows analyzed 2144, 3339, 3354, 3360, 3360, 3366, 3370 and 3468
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (’27’, ‘5699’, ‘5561’, ‘5700’, ‘282’, ‘2587’, ‘2034’, ‘225’, ‘156’, ‘2608’, ‘1566’, ‘2906’, ’89’, ”)) AND p.ID != 4223 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 23:33:29’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 8 Queries
### Total time: 17, Average time: 2.125
### Taking 2 , 2 , 2 , 2 , 2 , 2 , 2 , 3 seconds to complete
### Rows analyzed 1570, 2266, 2617, 2617, 2621, 3196, 3196 and 3196
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘373’, ‘197’, ‘10804’, ‘461’, ‘10803’, ’30’, ’64’, ‘10802’, ”)) AND p.ID != 9743 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 21:57:37’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 6 Queries
### Total time: 16, Average time: 2.66666666666667
### Taking 2 , 2 , 2 , 3 , 3 , 4 seconds to complete
### Rows analyzed 5475, 5476, 5477, 5478, 5479 and 5480
use dbXXX_gearcrave;
SELECTID
,post_author
,post_date
,post_date_gmt
,post_status
,post_name
,post_modified
,post_modified_gmt
,post_parent
,post_type
FROMwp_posts
WHERE ( (post_status = ‘XXX’ AND (post_type = ‘XXX’ OR post_type = ‘XXX’)) OR (post_status = ‘XXX’ AND post_type = ‘XXX’) ) AND post_password=’XXX’ ORDER BY post_modified DESC;use db27371_gearcrave;
SELECTID
,post_author
,post_date
,post_date_gmt
,post_status
,post_name
,post_modified
,post_modified_gmt
,post_parent
,post_type
FROMwp_posts
WHERE ( (post_status = ‘publish’ AND (post_type = ‘post’ OR post_type = ”)) OR (post_status = ‘publish’ AND post_type = ‘page’) ) AND post_password=” ORDER BY post_modified DESC;### 7 Queries
### Total time: 14, Average time: 2
### Taking 2 , 2 , 2 , 2 , 2 , 2 , 2 seconds to complete
### Rows analyzed 2175, 2490, 2493, 2493, 2493, 2690 and 3052
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘5681’, ‘225’, ‘4580’, ‘461’, ’30’, ‘5682’, ”)) AND p.ID != 4192 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 21:56:53’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 6 Queries
### Total time: 12, Average time: 2
### Taking 2 , 2 , 2 , 2 , 2 , 2 seconds to complete
### Rows analyzed 2365, 2365, 3656, 3735, 3754 and 4016
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘10689’, ‘10691’, ‘225’, ‘4580’, ‘197’, ’30’, ‘3911’, ‘1543’, ‘269’, ‘3476’, ”)) AND p.ID != 9327 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 20:31:17’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 6 Queries
### Total time: 12, Average time: 2
### Taking 2 , 2 , 2 , 2 , 2 , 2 seconds to complete
### Rows analyzed 1889, 1949, 2066, 2323, 2987 and 3001
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘4579’, ‘1297’, ’90’, ‘5681’, ‘225’, ’30’, ‘3911’, ”)) AND p.ID != 11744 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 23:41:51’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 4 Queries
### Total time: 8, Average time: 2
### Taking 2 , 2 , 2 , 2 seconds to complete
### Rows analyzed 2705, 2705, 4348 and 4449
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘4125’, ‘4124’, ‘3868’, ‘4351’, ‘219’, ‘2658’, ’22’, ‘4271’, ‘2795’, ‘225’, ‘461’, ‘3867’, ’24’, ’64’, ”)) AND p.ID != 2993 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 18:31:27’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 2 Queries
### Total time: 4, Average time: 2
### Taking 2 , 2 seconds to complete
### Rows analyzed 4118 and 4404
use dbXXX_lacityzine;
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;use db27371_lacityzine;
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘10356’, ‘10355’, ‘4579’, ‘7657’, ‘9117’, ‘225’, ‘197’, ’30’, ‘3911’, ‘269’, ‘3476’, ”)) AND p.ID != 8706 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 15:01:47’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;### 2 Queries
### Total time: 4, Average time: 2
### Taking 2 , 2 seconds to complete
### Rows analyzed 2492 and 3047
use dbXXX_lacityzine;
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;use db27371_lacityzine;
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘638’, ‘1775’, ‘197’, ‘461’, ’30’, ‘196’, ”)) AND p.ID != 9291 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 16:07:45’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;### 2 Queries
### Total time: 4, Average time: 2
### Taking 2 , 2 seconds to complete
### Rows analyzed 0 and 6742
use dbXXX_lacityzine;
SELECTID
,post_author
,post_date
,post_date_gmt
,post_status
,post_name
,post_modified
,post_modified_gmt
,post_parent
,post_type
FROMwp_posts
WHERE ( (post_status = ‘XXX’ AND (post_type = ‘XXX’ OR post_type = ‘XXX’)) OR (post_status = ‘XXX’ AND post_type = ‘XXX’) ) AND post_password=’XXX’ ORDER BY post_modified DESC;use db27371_lacityzine;
SELECTID
,post_author
,post_date
,post_date_gmt
,post_status
,post_name
,post_modified
,post_modified_gmt
,post_parent
,post_type
FROMwp_posts
WHERE ( (post_status = ‘publish’ AND (post_type = ‘post’ OR post_type = ”)) OR (post_status = ‘publish’ AND post_type = ‘page’) ) AND post_password=” ORDER BY post_modified DESC;### 1 Query
### Total time: 3, Average time: 3
### Taking 3 seconds to complete
### Rows analyzed 3321
use dbXXX_lacityzine;
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;use db27371_lacityzine;
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (’27’, ‘282’, ‘2587’, ’29’, ’22’, ‘461’, ’30’, ‘8643’, ‘5542’, ”)) AND p.ID != 9718 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 18:17:54’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;### 1 Query
### Total time: 2, Average time: 2
### Taking 2 seconds to complete
### Rows analyzed 2968
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘6693’, ‘8110’, ‘2356’, ‘193’, ‘8097’, ‘2642’, ‘8104’, ‘8108’, ‘1891’, ‘8100’, ‘8101’, ‘7833’, ‘4268’, ‘3225’, ‘7593’, ‘991’, ‘7087’, ‘192’, ‘4654’, ‘5683’, ‘4651’, ‘4369’, ‘8106’, ‘8098’, ‘8109’, ‘225’, ‘461’, ‘8107’, ‘2122’, ‘8105’, ‘8047’, ‘153’, ‘8103’, ‘2752’, ‘4653’, ‘691’, ‘8102’, ‘4931’, ‘4147’, ‘8099’, ‘6280’, ‘1359’, ”)) AND p.ID != 6529 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 11:00:05’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 1 Query
### Total time: 2, Average time: 2
### Taking 2 seconds to complete
### Rows analyzed 2000
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘193’, ‘4268’, ‘3225’, ‘7593’, ‘4654’, ‘5683’, ‘4651’, ‘4369’, ‘225’, ‘8707’, ‘5169’, ‘461’, ‘529’, ‘2496’, ‘4653’, ‘691’, ‘6915’, ‘2388’, ‘7655’, ‘4147’, ‘8708’, ”)) AND p.ID != 7104 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 13:52:04’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 1 Query
### Total time: 2, Average time: 2
### Taking 2 seconds to complete
### Rows analyzed 4063
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘3586’, ‘4579’, ‘5089’, ‘5096’, ‘5095’, ‘5041’, ‘5097’, ‘5090’, ‘225’, ‘4580’, ‘5094’, ‘5088’, ’30’, ‘3911’, ‘269’, ‘5092’, ‘5093’, ‘5091’, ‘3476’, ”)) AND p.ID != 3752 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 18:28:19’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
### 1 Query
### Total time: 2, Average time: 2
### Taking 2 seconds to complete
### Rows analyzed 2040
SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’XXX’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’, ‘XXX’)) AND p.ID != XXX AND p.post_status = ‘XXX’ AND p.post_date_gmt < ‘XXX’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT XXX;SELECT DISTINCT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM wp_term_taxonomy t_t, wp_term_relationships t_r, wp_posts p WHERE t_t.taxonomy =’post_tag’ AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN (‘9609’, ‘7608’, ‘10041’, ’30’, ‘153’, ”)) AND p.ID != 8391 AND p.post_status = ‘publish’ AND p.post_date_gmt < ‘2008-08-14 21:22:13’ GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC LIMIT 5;
- The topic ‘Slow wordpress queries bringing down all my sites on MediaTemple (gs)’ is closed to new replies.