MySQL Slow query problem
-
My host shows our site being problematic when it comes to the particular query below. It takes 2-3 seconds to complete.
Any ideas on how to speed this up? Do we have a DB that’s just too big on these three tables?
Created 06:55 PM 07/28/2008
### 74 Queries
### Total time: 154, Average time: 2.08108108108108
### Taking 2 to 3 seconds to complete
### Rows analyzed 55576 – 56375
SELECT t.*, tt.*
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id
INNER JOIN wp_term_relationships AS tr ON tt.term_taxonomy_id = tr.term_taxonomy_id
INNER JOIN wp_posts AS p ON tr.object_id = p.ID
WHERE tt.taxonomy IN ( ‘XXX’ )
AND p.post_date_gmt < ‘XXX’AND tt.count > XXX
GROUP BY t.term_id
ORDER BY tt.count DESC
LIMIT XXX;SELECT t.*, tt.*
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id
INNER JOIN wp_term_relationships AS tr ON tt.term_taxonomy_id = tr.term_taxonomy_id
INNER JOIN wp_posts AS p ON tr.object_id = p.ID
WHERE tt.taxonomy IN ( ‘post_tag’ )
AND p.post_date_gmt < ‘2008-07-28 17:49:23’AND tt.count > 0
GROUP BY t.term_id
ORDER BY tt.count DESC
LIMIT 45;
- The topic ‘MySQL Slow query problem’ is closed to new replies.