Use estimateRowCount() in CleanupTable rather than select count(*) which will take...
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 8 Jul 2011 22:08:19 +0000 (22:08 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 8 Jul 2011 22:08:19 +0000 (22:08 +0000)
maintenance/cleanupTable.inc

index 67a3251..60f2346 100644 (file)
@@ -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" );