Index: branches/wmf-deployment/includes/specials/SpecialMostlinked.php |
— | — | @@ -27,7 +27,19 @@ |
28 | 28 | |
29 | 29 | $dbr = wfGetDB( DB_SLAVE ); |
30 | 30 | |
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 | + } |
32 | 44 | |
33 | 45 | list( $pagelinks, $page ) = $dbr->tableNamesN( 'pagelinks', 'page' ); |
34 | 46 | return |
— | — | @@ -38,7 +50,7 @@ |
39 | 51 | FROM $pagelinks |
40 | 52 | LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title |
41 | 53 | GROUP BY pl_namespace, pl_title |
42 | | - HAVING COUNT(*) > 1"; |
| 54 | + HAVING COUNT(*) > $cutoff"; |
43 | 55 | } |
44 | 56 | |
45 | 57 | /** |
Property changes on: branches/wmf-deployment/includes/specials |
___________________________________________________________________ |
Name: svn:mergeinfo |
46 | 58 | - /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 |
47 | 59 | + /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 |