[wp-trac] [WordPress Trac] #50161: Slow query in WP_Posts_List_Table, no way to avoid with filters/hooks

WordPress Trac noreply at wordpress.org
Thu Sep 4 12:50:05 UTC 2025


#50161: Slow query in WP_Posts_List_Table, no way to avoid with filters/hooks
--------------------------------+------------------------------------------
 Reporter:  LucasMS             |       Owner:  SergeyBiryukov
     Type:  enhancement         |      Status:  accepted
 Priority:  normal              |   Milestone:  6.9
Component:  Database            |     Version:  5.4.1
 Severity:  normal              |  Resolution:
 Keywords:  has-patch 2nd-      |     Focuses:  administration, performance
  opinion                       |
--------------------------------+------------------------------------------
Changes (by SirLouen):

 * component:  Posts, Post Types => Database


Comment:

 Replying to [comment:31 jonsurrell]:
 > Given that this was generated test data and not likely to follow real
 world data patterns (for example, I doubt the distribution of post type,
 author, and status is uniform) I'm confident enough that the performance
 improvement is real and likely to mitigate the problem described in this
 ticket for large sites. I'm not confident enough in the results to
 recommend a specific index over another and would instead rely on the TSA
 index that @josephscott selected based on working with real sites.

 Like @mukesh27 commented, there is another variant commented on in #15499
 that can be seen in [https://github.com/WordPress/wordpress-
 develop/pull/3117 PR 3117]

 > We added CREATE INDEX type_status_modified ON wp_posts (post_type,
 post_status, post_modified_gmt); and CREATE INDEX
 type_status_modified_no_id ON wp_posts (post_type, post_status,
 post_date_gmt);

 I have not tested it yet, but since you made the test env, could you also
 check this to see whether this is better or not?

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


More information about the wp-trac mailing list