Title: Slow Query
Last modified: August 31, 2016

---

# Slow Query

 *  [masc](https://wordpress.org/support/users/masc/)
 * (@masc)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/slow-query-8/)
 * we have 2 queries that are killing us!, each one is running 2 or 3 times, every
   minute and causing performance issues
 * SELECT meta_key FROM wp_postmeta\n\t\t\t\tGROUP BY meta_key\n\t\t\t\tHAVING meta_key
   NOT LIKE ‘\\_%’ and meta_key NOT LIKE ‘field_%’\n\t\t\t\tORDER BY meta_key\n\
   t\t\t\tLIMIT 150
 * This first we believe is a meta box in the edit post page
 * SELECT ID, post_content, post_name, post_author, post_parent, post_date_gmt, 
   post_date, post_date_gmt, post_title, post_type\n\t\t\t FROM wp_posts\n\t\t\t
   WHERE post_status=’publish’\n\t\t\t AND (DATEDIFF(CURDATE(), post_date_gmt)<=
   2)\n\t\t\t AND post_type IN (‘post’,’page’)\n\t\t\t ORDER BY post_date_gmt DESC\
   n\t\t\t LIMIT 0, 1\n\t\t
 * the second one, we don’t know where
    Can any one help us??

Viewing 1 replies (of 1 total)

 *  [George](https://wordpress.org/support/users/ccto/)
 * (@ccto)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/slow-query-8/#post-7345790)
 * For first query, you might have a look at
 * [http://wordpress.stackexchange.com/questions/187612/admin-very-slow-edit-page-caused-by-core-meta-query](http://wordpress.stackexchange.com/questions/187612/admin-very-slow-edit-page-caused-by-core-meta-query)
   
   [https://core.trac.wordpress.org/ticket/24498](https://core.trac.wordpress.org/ticket/24498)
 * —
 * For 2nd query, it **seems** the function is to get the most recent published 
   post (or page), which also published in the last 2 day

Viewing 1 replies (of 1 total)

The topic ‘Slow Query’ is closed to new replies.

## Tags

 * [metabox](https://wordpress.org/support/topic-tag/metabox/)
 * [performance](https://wordpress.org/support/topic-tag/performance/)
 * [slow query](https://wordpress.org/support/topic-tag/slow-query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [George](https://wordpress.org/support/users/ccto/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/slow-query-8/#post-7345790)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
