Page MenuHomePhabricator

UserSelectQueryBuilder times out when passed ~40k of user IDs
Closed, InvalidPublic

Description

While investigating T330071#10165865, T354222 and T375784, I noticed a lot of the time is spent in UserSelectQueryBuilder, while it is trying to process a significant number of user IDs. When working with ~40k of user IDs, this shows the speed:

> echo count($ids);
41872
> $start = microtime(true); $res = iterator_to_array(\MediaWiki\MediaWikiServices::getInstance()->getUserIdentityLookup()->newSelectQueryBuilder()->registered()->named()->whereUserIds( $ids )->hidden( false )->fetchUserIdentities()); $end = microtime(true);

> echo $end - $start;
114.9415910244
>

Why does it take that long?

Attachments

Set of users used: