Page MenuHomePhabricator

[Platform API] Improve efficiency of database queries in PlatformStatsSummaryJob
Open, Needs TriagePublic

Description

In line 105, foreach loop loops over all $wikis and resolves wikiDB()->first() once per $wiki.

Note:
Also line 61 and 63, count() query repeated inside a loop. But it's not really ORM N+1 pattern if I understand it correctly, just repeated queries by a date range, so it doesn't scale with the number of users/wikis/items/...etc. We can skip this one.