[wp-trac] [WordPress Trac] #15499: Add an index for get_lastpostmodified query

WordPress Trac noreply at wordpress.org
Thu Sep 19 10:33:31 UTC 2019


#15499: Add an index for get_lastpostmodified query
-------------------------------------------------+-------------------------
 Reporter:  simonwheatley                        |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Database                             |     Version:  3.0.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback 4.1-early     |     Focuses:
  commit bulk-reopened                           |  performance
-------------------------------------------------+-------------------------

Comment (by Krstarica):

 Still horribly slow in WordPress 5.2.3:

 # Query_time: 2.345178  Lock_time: 0.000041  Rows_sent: 1  Rows_examined:
 542040
 `SELECT post_date_gmt FROM wp_posts WHERE post_status = 'publish' AND
 post_type IN ('post', 'page', 'attachment') ORDER BY post_date_gmt DESC
 LIMIT 1;`

 The same result, but 4 times faster (but still slow: 0.65 sec):
 `SELECT MAX(post_date_gmt) FROM wp_posts WHERE post_status = 'publish' AND
 post_type IN ('post', 'page', 'attachment');`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/15499#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list