r91763 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91762‎ | r91763 | r91764 >
Date:22:08, 8 July 2011
Author:demon
Status:resolved
Tags:
Comment:
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 :)
Modified paths:
  • /trunk/phase3/maintenance/cleanupTable.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/cleanupTable.inc
@@ -101,7 +101,8 @@
102102 }
103103
104104 $table = $params['table'];
105 - $count = $dbr->selectField( $table, 'count(*)', $params['conds'], __METHOD__ );
 105+ // count(*) would melt the DB for huge tables, we can estimate here
 106+ $dbr->estimateRowCount( $table, '*', '', __METHOD__ );
106107 $this->init( $count, $table );
107108 $this->output( "Processing $table...\n" );
108109

Follow-up revisions

RevisionCommit summaryAuthorDate
r91764MFT r91763demon22:09, 8 July 2011
r91765Wow major typo, r91763demon22:15, 8 July 2011

Status & tagging log