Currently, updateIsActiveFlagForMentees.php queries the database individually for each mentee it processes. For huge wikis, that can take a significant portion of time (see the four hours in T432959#12200953, for example). Most methods updateIsActiveFlagForMentees.php use support batching, at least:
- UserIdentityLookup::newSelectQueryBuilder()
- UserRegistrationLookup::getFirstRegistrationBatch() (technically a difference from getRegistration(), which we use, but shouldn't be significant, plus easy to implement getRegistrationBatch anyway)
Unfortunately, UserEditTracker::getLatestEditTimestamp doesn't have a batched version, and adding it would be a ton of work (at the least, ActorStore would need to have a batched version too). Given actor table is now locked in (and as we query it anyway), a direct query seems easiest at the moment.