Last modified: 2014-06-05 10:03:30 UTC
Viewing Special:Recentchanges as a logged-in user results in a huge amount of database queries. In particular, the following three queries are run for every row: SELECT /* Title::loadRestrictions */ * FROM `page_restrictions` WHERE pr_page = '142' SELECT /* Title::loadRestrictionsFromRow */ page_restrictions FROM `page` WHERE page_id = '142' LIMIT 1 SELECT /* Title::getLatestRevID */ page_latest FROM `page` WHERE page_id = '142' LIMIT 1 It should be easy to merge the first two queries. Also, the results aren't cached, which means that 5 changes to page_id 142 results in the aforementioned query block being run 5 times, each time with the exact same results.
This should be merged into the main RC query. We shouldn't need caching here, it should just be part of the query we already do. At most these should be two or three extra queries per view, not per row. The getLatestRevID is probably for rollback links. That feature (r45918) can just be killed if it's not easy to get it to work reasonably, IMO. The others probably can't just be removed, they look like permissions checks, but it should be possible to roll them into the existing query/queries. While we're at it, Linker::link() is taking a huge amount of CPU time on RC, that should be investigated.
Didn't you fix some of this? What's still to do?
I didn't, someone else did (Domas, I think?). This might actually be fixed now, yes, in which case the bug can be closed.