From: Chad Horohoe Date: Fri, 8 Jul 2011 22:08:19 +0000 (+0000) Subject: Use estimateRowCount() in CleanupTable rather than select count(*) which will take... X-Git-Tag: 1.31.0-rc.0~28972 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=6ed238574c891f1d7f95623253ae24fa621ab622;p=lhc%2Fweb%2Fwiklou.git Use estimateRowCount() in CleanupTable rather than select count(*) which will take forevvvveeeerrrrr on tables like image or page. It's only used for estimating progress, so a little estimating is ok :) --- diff --git a/maintenance/cleanupTable.inc b/maintenance/cleanupTable.inc index 67a325103f..60f234602e 100644 --- a/maintenance/cleanupTable.inc +++ b/maintenance/cleanupTable.inc @@ -101,7 +101,8 @@ class TableCleanup extends Maintenance { } $table = $params['table']; - $count = $dbr->selectField( $table, 'count(*)', $params['conds'], __METHOD__ ); + // count(*) would melt the DB for huge tables, we can estimate here + $dbr->estimateRowCount( $table, '*', '', __METHOD__ ); $this->init( $count, $table ); $this->output( "Processing $table...\n" );