From b5cf6fe9a32fc90a6cd13dd7d57f0006deef9d4d Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 6 Jul 2007 04:23:33 +0000 Subject: [PATCH] Use SiteStats accessors so we benefit from caching, etc. in wfQueriesMustScale() - per Simetrical --- includes/GlobalFunctions.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index b86bd8475b..5a96e72748 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2268,15 +2268,10 @@ function wfQueriesMustScale() { // Unconditional performance requirement if( $wgMiserMode ) return true; - // Make a rough estimate - $dbr = wfGetDB( DB_SLAVE ); - $stats = $dbr->selectRow( - 'site_stats', - array( 'ss_total_pages AS pages', 'ss_total_edits AS edits', 'ss_users AS users' ), - array(), - __METHOD__ - ); - return $stats->pages > 100000 && $stats->edits > 1000000 && $stats->users > 10000; + // Rough estimate based on statistics + return SiteStats::pages() > 100000 + && SiteStats::edits() > 1000000 + && SiteStats::users() > 10000; } /** -- 2.20.1