Last modified: 2014-06-05 10:03:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T20229, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18229 - Special:Recentchanges for logged-in users should use fewer sql queries
Special:Recentchanges for logged-in users should use fewer sql queries
Status: NEW
Product: MediaWiki
Classification: Unclassified
Recent changes (Other open bugs)
1.14.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-28 13:17 UTC by Roan Kattouw
Modified: 2014-06-05 10:03 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2009-03-28 13:17:08 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.
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-03-29 13:57:30 UTC
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.
Comment 2 Niklas Laxström 2009-05-23 08:21:57 UTC
Didn't you fix some of this? What's still to do?
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-05-24 14:00:32 UTC
I didn't, someone else did (Domas, I think?).  This might actually be fixed now, yes, in which case the bug can be closed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links