title: Wordpress performance (Slow queries)
body: <p>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:</p>
  
  <pre><code># 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;
  </code></pre>
  
  <p>More info:
  WP 3.8.1</p>
  
  <p>Plugins:
   - Advanced Custom Fields
   - Audio player
   - Avatars
   - Broken Link Checker
   - Capability Manager
   - Cron GUI
   - DB Cache Reloaded Fix
   - FV WordPress Flowplayer
   - Google XML Sitemaps
   - Hide Categories
   - NextGEN Gallery
   - Query Monitor
   - Scissors
   - Simple Image Sizes
   - ThemeSmith
   - Theme Test Drive
   - TweetMeme Retweet Button
   - User Avatar
   - video-flv-converter
   - Vixy YouTube Embed
   - WordPress Database Ping
   - WP-EMail
   - WP-Optimize
   - WP-Paginate
   - WP-Polls
   - WP-PostViews
   - Tabulky
   - WP Image Size Limit
   - WP Minify
   - WP Super Cache
   - Youtuber</p>
  
  <p>I deactived All in one SEO pack becuase I found this plugin is reason why websites is slow but looks like our website is still slow.</p>
  
  <p>We have published 19650 post and 167 categories.</p>
  
  <p>Theme is super simple and P3 (plugin performance profiler) show very nice load time for theme.</p>
  
  <p>We have 141 queries on HP, 162 queries in the article, 113 queries in the category.</p>
  
  <p>any help much appreciate</p>
  
  <p>BTW: I am sorry my english is not a good</p>