Index: trunk/phase3/includes/specials/SpecialMostlinked.php |
— | — | @@ -23,7 +23,24 @@ |
24 | 24 | function isSyndicated() { return false; } |
25 | 25 | |
26 | 26 | function getSQL() { |
| 27 | + global $wgMiserMode; |
| 28 | + |
27 | 29 | $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 | + |
28 | 45 | list( $pagelinks, $page ) = $dbr->tableNamesN( 'pagelinks', 'page' ); |
29 | 46 | return |
30 | 47 | "SELECT 'Mostlinked' AS type, |
— | — | @@ -33,7 +50,7 @@ |
34 | 51 | FROM $pagelinks |
35 | 52 | LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title |
36 | 53 | GROUP BY pl_namespace, pl_title |
37 | | - HAVING COUNT(*) > 1"; |
| 54 | + HAVING COUNT(*) > $cutoff"; |
38 | 55 | } |
39 | 56 | |
40 | 57 | /** |
Property changes on: trunk/phase3/includes/specials |
___________________________________________________________________ |
Name: svn:mergeinfo |
41 | 58 | + /branches/REL1_15/phase3/includes/specials:51646 |
/branches/sqlite/includes/specials:58211-58321 |
/branches/wmf-deployment/includes/specials:53381,56967 |