r59694 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59693‎ | r59694 | r59695 >
Date:05:56, 3 December 2009
Author:tstarling
Status:deferred
Tags:
Comment:
Fixed miser mode hack broken by Brion in r57448: merged my version of it from trunk r59693.
Modified paths:
  • /branches/wmf-deployment/includes/specials (modified) (history)
  • /branches/wmf-deployment/includes/specials/SpecialMostlinked.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/includes/specials/SpecialMostlinked.php
@@ -27,7 +27,19 @@
2828
2929 $dbr = wfGetDB( DB_SLAVE );
3030
31 - if ($wgMiserMode) { $cutoff = 100; } else { $cutoff = 1; }
 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+ }
3244
3345 list( $pagelinks, $page ) = $dbr->tableNamesN( 'pagelinks', 'page' );
3446 return
@@ -38,7 +50,7 @@
3951 FROM $pagelinks
4052 LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title
4153 GROUP BY pl_namespace, pl_title
42 - HAVING COUNT(*) > 1";
 54+ HAVING COUNT(*) > $cutoff";
4355 }
4456
4557 /**
Property changes on: branches/wmf-deployment/includes/specials
___________________________________________________________________
Name: svn:mergeinfo
4658 - /branches/REL1_15/phase3/includes/specials:51646
/branches/wmf-deployment/includes/specials:53381
/trunk/phase3/includes/specials:56188,57154-57447,57530,57541,57602,57916,58151,58219,58633,58816
4759 + /branches/REL1_15/phase3/includes/specials:51646
/branches/sqlite/includes/specials:58211-58321
/branches/wmf-deployment/includes/specials:53381
/trunk/phase3/includes/specials:56188,56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57154-57448,57530,57541,57602,57916,58151,58219,58633,58816,59693

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57448Merging core changes from trunk r56150 through r57447 ... there may be some m...brion00:35, 7 October 2009
r59693Merged r56967 from wmf-deployment: for performance, don't consider pages with...tstarling05:38, 3 December 2009

Status & tagging log