Discovered while trying to see why watchlist has suddenly got so slow.
As an example, currently loading a watchlist makes 919 queries: https://logstash.wikimedia.org/goto/1610dd046bee4e8cbb0e9a51270b0ccb
Many of them are exact same queries. In one case I used XhGui, it's calling the user edit count for the same user 101 times in context of the one request: https://performance.wikimedia.org/xhgui/run/symbol?id=6668463540e83c26e289c1da&symbol=MediaWiki%5CUser%5CUserEditTracker%3A%3AgetUserEditCount
excimer says 12% of the time of the request is being spent doing the exact same query 100 times: https://performance.wikimedia.org/excimer/profile/0a96d7cc5babe7eb
Stack trace: