Summary
In the QA of T418293: Suggested Investigations: Create a filter to filter out cases with no users blocked, it was seen that the GlobalBlockCheck is running slowly when many users are checked. We should batch the queries it performs to reduce the time it takes to execute
Background
- GlobalBlocking currently has no way to lookup multiple global blocks for different targets at once
- This functionality exists for MediaWiki core blocks
- We need this functionality so that we can avoid making hundreds of queries where each query is per-user in GlobalBlockCheck
- Additionally, GlobalBlockCheck calls ::centralIdFromLocalUser for each user which means a query per user
- We should make use of the ::lookupAttachedUserNames method which we can call with multiple usernames at once
Technical details
As can be seen by this Excimer, the request with this filter takes a long time on just the GlobalBlockCheck:
Acceptance criteria
- The queries in GlobalBlockCheck are batched

