r59693 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59692‎ | r59693 | r59694 >
Date:05:38, 3 December 2009
Author:tstarling
Status:deferred
Tags:
Comment:
Merged r56967 from wmf-deployment: for performance, don't consider pages with very few links for Special:Mostlinked.

Implemented a page count threshold as Domas suggested in his commit message. A fractional power seems to make sense for scaling from page count to links-per-page, since it has the right kind of limits, so I used a square root bounded between 1 and 100.
Modified paths:
  • /trunk/phase3/includes/specials (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMostlinked.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialMostlinked.php
@@ -23,7 +23,24 @@
2424 function isSyndicated() { return false; }
2525
2626 function getSQL() {
 27+ global $wgMiserMode;
 28+
2729 $dbr = wfGetDB( DB_SLAVE );
 30+
 31+ # In miser mode, reduce the query cost by adding a threshold for large wikis
 32+ if ( $wgMiserMode ) {
 33+ $numPages = SiteStats::pages();
 34+ if ( $numPages > 10000 ) {
 35+ $cutoff = 100;
 36+ } elseif ( $numPages > 100 ) {
 37+ $cutoff = intval( sqrt( $numPages ) );
 38+ } else {
 39+ $cutoff = 1;
 40+ }
 41+ } else {
 42+ $cutoff = 1;
 43+ }
 44+
2845 list( $pagelinks, $page ) = $dbr->tableNamesN( 'pagelinks', 'page' );
2946 return
3047 "SELECT 'Mostlinked' AS type,
@@ -33,7 +50,7 @@
3451 FROM $pagelinks
3552 LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title
3653 GROUP BY pl_namespace, pl_title
37 - HAVING COUNT(*) > 1";
 54+ HAVING COUNT(*) > $cutoff";
3855 }
3956
4057 /**
Property changes on: trunk/phase3/includes/specials
___________________________________________________________________
Name: svn:mergeinfo
4158 + /branches/REL1_15/phase3/includes/specials:51646
/branches/sqlite/includes/specials:58211-58321
/branches/wmf-deployment/includes/specials:53381,56967

Follow-up revisions

RevisionCommit summaryAuthorDate
r59694Fixed miser mode hack broken by Brion in r57448: merged my version of it from...tstarling05:56, 3 December 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56967quick hack for special:mostlinkedpages - in case of misermode it won't show p...midom00:36, 27 September 2009

Status & tagging log