Title: very slow query
Last modified: August 20, 2016

---

# very slow query

 *  [b747fp](https://wordpress.org/support/users/b747fp/)
 * (@b747fp)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/very-slow-query/)
 * this query works, but it takes upwards of 20 seconds to run on a quad core dedi…
   how can i optimize this?
 *     ```
       $slides=get_posts(
       	array('post_type' => 'any', 'numberposts' => 5, 'orderby' => 'date', 'order' => 'desc', "tax_query" =>
       		array(
       				"relation" => "OR",
       				 array(
       					"field" => "id",
       					"terms" => array(36),
       					"taxonomy" => "category",
       					"operator" => "IN"
       				),
       				array(
       					"field" => "id",
       					"terms" => array(36),
       					"taxonomy" => "music-categories",
       					"operator" => "IN"
       				),
       				array(
       					"field" => "id",
       					"terms" => array(36),
       					"taxonomy" => "video-categories",
       					"operator" => "IN"
       				),
       				array(
       					"field" => "id",
       					"terms" => array(36),
       					"taxonomy" => "mixtape-categories",
       					"operator" => "IN"
       				)
       			)
       		)
       );
       ```
   

The topic ‘very slow query’ is closed to new replies.

## Tags

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

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

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
