[wp-trac] [WordPress Trac] #25178: multisite network admin to delete user attempts to load millions of users into memory
WordPress Trac
noreply at wordpress.org
Thu Aug 29 14:46:58 UTC 2013
#25178: multisite network admin to delete user attempts to load millions of users
into memory
--------------------------+-----------------------------
Reporter: _ck_ | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Multisite | Version: 3.6
Severity: major | Keywords:
--------------------------+-----------------------------
There is an unbound mysql query in multisite network admin.
{{{
$blog_users = get_users( array( 'blog_id' => $details->userblog_id ) );
}}}
around line 53 in `wp-admin/network/users.php`
If there are millions of users with wp_capabilities, it will attempt to
load all of them into memory at once.
Then it attempts to do a one-by-one comparison in a php loop.
This entire section of code needs to be rewritten to simply load the users
by id and simply do a ` LIKE '%\_capabilities' ` then compare their
capabilities against the requested blog ids. Or even better since you know
the blog ids and capabilities, just request the specific `meta_key` ie.
wp_123_capabilities which would be way faster because it has an index.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25178>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list