[wp-trac] [WordPress Trac] #18120: Slow SQL in get_adjacent_post()

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 19 18:07:03 UTC 2012


#18120: Slow SQL in get_adjacent_post()
------------------------------+--------------------
 Reporter:  javert03          |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  3.5
Component:  Query             |     Version:  3.2.1
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+--------------------

Comment (by ryan):

 New query.

 {{{
 SQL query: EXPLAIN SELECT p.id FROM wp_trunk_posts AS p WHERE p.post_date
 < '2012-09-19 18:01:23' AND p.post_type = 'post' AND p.post_status =
 'publish' ORDER BY p.post_date DESC LIMIT 1;
 Rows: 1

 id      select_type     table   type    possible_keys   key     key_len
 ref     rows    Extra
 1       SIMPLE  p       range   type_status_date        type_status_date
 132     NULL    1       Using where; Using index
 }}}


 Old query.

 {{{
 SQL query: EXPLAIN SELECT p.* FROM wp_trunk_posts AS p WHERE p.post_date <
 '2012-09-19 18:05:11' AND p.post_type = 'post' AND p.post_status =
 'publish' ORDER BY p.post_date DESC LIMIT 1;
 Rows: 1

 id      select_type     table   type    possible_keys   key     key_len
 ref     rows    Extra
 1       SIMPLE  p       range   type_status_date        type_status_date
 132     NULL    1       Using where
 }}}

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


More information about the wp-trac mailing list