Title: Slow sql query
Last modified: September 1, 2016

---

# Slow sql query

 *  [mariods](https://wordpress.org/support/users/chaosm/)
 * (@chaosm)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/slow-sql-query-2/)
 * Hi i have a problem with my site.
    Due to sweep plugin
 * Post Sweep
    There are a total of 46.031 Posts and 357.583 Post Meta.
 * Details Count % Of Action
    Revisions 0 0% N/A Auto Drafts 2 0% Sweep Details 
   Deleted Posts 0 0% N/A Orphaned Post Meta 0 0% N/A Duplicated Post Meta 0 0% 
   N/A oEmbed Caches In Post Meta 0 0% N/A
 * Comment Sweep
    There are a total of 228.826 Comments and 442 Comment Meta.
 * Details Count % Of Action
    Unapproved Comments 9 0% Sweep Details Spammed Comments
   15 0.01% Sweep Details Deleted Comments 0 0% N/A Orphaned Comment Meta 0 0% N/
   A Duplicated Comment Meta 0 0% N/A
 * User Sweep
    There are a total of 24 Users and 518 User Meta.
 * Details Count % Of Action
    Orphaned User Meta 0 0% N/A Duplicated User Meta 0
   0% N/A
 * Term Sweep
    There are a total of 2.738 Terms, 0 Term Meta, 2.738 Term Taxonomy
   and 43.944 Term Relationships.
 * Details Count % Of Action
    Orphaned Term Meta 0 0% N/A Duplicated Term Meta 0
   0% N/A Orphaned Term Relationship 0 0% N/A Unused Terms Note that some unused
   terms might belong to draft posts that have not been published yet. Only sweep
   this when you do not have any draft posts.
 * 0 0% N/A
 * I have optimized the db.
 * At home page i have a slow query that some times gives 50 server load and 503
   error
 * **Slow Database Queries (above 0,05s)**
 * 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_postmeta.meta_key
   = ‘_infra_post_views_count’ ) AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status
   = ‘publish’ OR wp_posts.post_status = ‘private’) GROUP BY wp_posts.ID ORDER BY
   wp_postmeta.meta_value+0 DESC LIMIT 0, 4
 * **Time 0,1286**
 * how could solve this problem?

The topic ‘Slow sql query’ is closed to new replies.

## Tags

 * [post_meta](https://wordpress.org/support/topic-tag/post_meta/)
 * [SQL queries](https://wordpress.org/support/topic-tag/sql-queries/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [mariods](https://wordpress.org/support/users/chaosm/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/slow-sql-query-2/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
