[wp-trac] [WordPress Trac] #24837: querying optimization for category AND searching

WordPress Trac noreply at wordpress.org
Fri Aug 16 16:35:31 UTC 2013


#24837: querying optimization for category AND searching
-------------------------------------+------------------------------
 Reporter:  robertv123               |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Taxonomy                 |     Version:  3.6
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------------------

Comment (by robertv123):

 I have not figure out away to use a range index I used {{{FROM wp_posts
 USE INDEX (type_status_date)}}} in the query in this manner to no luck.
 The documentation seams to imply that the range index only works with
 constants.

 {{{
  SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts use index (
 type_status_date) WHERE 1=1  AND ( (
 SELECT COUNT(1)                                         FROM
 wp_term_relationships                                         WHERE
 term_taxonomy_id IN (5,453)                                         AND
 object_id = wp_posts.ID                                 ) = 2 ) AND
 wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP
 BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 20;
 }}}

 And explain indicates type index.

 The tests where done on mysql 5.5.31

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24837#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list