[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
Mon Sep 8 04:31:08 UTC 2025


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

 * keywords:  has-patch 2nd-opinion =>
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Reopening for some follow up: `dbDelta()` will modify the table without
 the need to call `$wpdb->query()` in the upgrade routine. The database
 version bump alone will trigger it, [https://github.com/WordPress
 /wordpress-develop/blob/9d802e0295ec58df922a5443496d032c54d9293a/src/wp-
 admin/includes/upgrade.php#L3336-L3342 code ref]

 Testing notes:
 * Checkout r60716
 * Fresh install: `wp db clean --yes; wp core install --url=http://wp-
 dev.local/ --title="WP Dev" --admin_user=admin --admin_password=password
 --admin_email=admin at example.com` (your specific commands will vary)
 * Log in
 * Checkout trunk
 * Remove `ALTER` command in the upgrade routine
 * Reload dashboard page
 * Go through db upgrade as prompted
 * Review DB schema

 PR incoming but I won't commit until I get a logic check as `dbDelta()` is
 a little funky.

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


More information about the wp-trac mailing list