From 6ed238574c891f1d7f95623253ae24fa621ab622 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 8 Jul 2011 22:08:19 +0000 Subject: [PATCH] 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 :) --- maintenance/cleanupTable.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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" ); -- 2.20.1