X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupTable.inc;h=1c2797625cd9c06bb046dd98f9233d14eb363101;hb=12764355c4b9477f82208523ffad76d42bd7ff35;hp=67a325103fc016cfd7a3aa4c1ff52775969fe1ee;hpb=066984cbe3ccac2d54bcb2097f345836cd1a8141;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupTable.inc b/maintenance/cleanupTable.inc index 67a325103f..1c2797625c 100644 --- a/maintenance/cleanupTable.inc +++ b/maintenance/cleanupTable.inc @@ -43,7 +43,7 @@ class TableCleanup extends Maintenance { public function execute() { global $wgUser; - $wgUser->setName( 'Conversion script' ); + $wgUser = User::newFromName( 'Conversion script' ); $this->dryrun = $this->hasOption( 'dry-run' ); if ( $this->dryrun ) { $this->output( "Checking for bad titles...\n" ); @@ -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 + $count = $dbr->estimateRowCount( $table, '*', '', __METHOD__ ); $this->init( $count, $table ); $this->output( "Processing $table...\n" );