Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5534

netbrana on "Mysql database is slow"

$
0
0

Hello,

can someone help me with wp queries? Our website is slow. We noticed that there are two queries with long query time. I need to find what is using this queries. Here is queries from log:

# Query_time: 21.955256 Lock_time: 1.873010 Rows_sent: 3 Rows_examined: 3356082

SELECT wposts.* FROM wp_posts wposts
LEFT JOIN wp_postmeta wpostmeta ON wposts.ID = wpostmeta.post_id
LEFT JOIN wp_term_relationships ON (wposts.ID = wp_term_relationships.object_id)
LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
WHERE wposts.post_status = 'publish'
GROUP BY wposts.ID
ORDER BY wposts.post_date DESC
LIMIT 3;

# Query_time: 7.584517 Lock_time: 0.000062 Rows_sent: 3 Rows_examined: 100621

SET timestamp=1390921247;
SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') AND (wp_postmeta.meta_key = 'views' ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value DESC LIMIT 0, 3;

any help much appreciate

BTW: I am sorry my english is not a good


Viewing all articles
Browse latest Browse all 5534

Trending Articles