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

WordPress Trac noreply at wordpress.org
Fri May 3 10:48:43 UTC 2019


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

Comment (by mwidmann):

 Same issue here. This functionality doesn't behave well with large post
 tables (in our case 300k+ posts).

 There are two changes I'd love to see in `post.php`:

 `get_lastpostmodified` has a pre and after filter, where especially the
 pre filter is useful as it allows to provide different data, instead of
 running this extremely slow query. `get_lastpostdate` sadly doesn't
 provide such functionality.

 Worse is the issue in `_get_last_post_time` where when `$timezone` is set
 to `Blog` it selects the value of either `post_date` or `post_modified`,
 which at least for post_date would use the index `type_status_date` on
 wp_posts, but then orders by `post_{$field}_gmt` which skips the index.

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


More information about the wp-trac mailing list