WordPress.org

Ready to get started?Download WordPress

Forums

very slow query (1 post)

  1. b747fp
    Member
    Posted 1 year ago #

    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"
    				)
    			)
    		)
    );

Topic Closed

This topic has been closed to new replies.

About this Topic