From: Aaron Schulz Date: Fri, 4 Apr 2008 04:15:21 +0000 (+0000) Subject: * Make revisiondelete queries not suck (many where index misses) X-Git-Tag: 1.31.0-rc.0~48636 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=e8e75402978fee9b245f64f278448412456e675f;p=lhc%2Fweb%2Fwiklou.git * Make revisiondelete queries not suck (many where index misses) * Document var --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 5aac654698..c7d6938bb5 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -322,6 +322,7 @@ class LogEventsList { * @param OutputPage $out * @param string $type * @param string $page + * @param string $user */ public static function showLogExtract( $out, $type='', $page='', $user='' ) { global $wgUser; diff --git a/includes/SpecialRevisiondelete.php b/includes/SpecialRevisiondelete.php index 5280f020d6..eeaa957838 100644 --- a/includes/SpecialRevisiondelete.php +++ b/includes/SpecialRevisiondelete.php @@ -882,7 +882,7 @@ class RevisionDeleter { $Id_set[]=$timestamp; $count++; - $this->updateArchive( $revObjs[$timestamp], $bitfield ); + $this->updateArchive( $revObjs[$timestamp], $title, $bitfield ); } } // For logging, maintain a count of revisions @@ -1234,31 +1234,37 @@ class RevisionDeleter { function updateRevision( $rev, $bitfield ) { $this->dbw->update( 'revision', array( 'rev_deleted' => $bitfield ), - array( 'rev_id' => $rev->getId() ), + array( 'rev_id' => $rev->getId(), + 'rev_page' => $rev->getPage() ), __METHOD__ ); } /** * Update the revision's rev_deleted field * @param Revision $rev + * @param Title $title * @param int $bitfield new rev_deleted bitfield value */ - function updateArchive( $rev, $bitfield ) { + function updateArchive( $rev, $title, $bitfield ) { $this->dbw->update( 'archive', array( 'ar_deleted' => $bitfield ), - array( 'ar_rev_id' => $rev->getId() ), + array( 'ar_namespace' => $title->getNamespace(), + 'ar_title' => $title->getDBKey(), + 'ar_timestamp' => $this->dbw->timestamp( $rev->getTimestamp() ), + 'ar_rev_id' => $rev->getId() ), __METHOD__ ); } /** * Update the images's oi_deleted field - * @param File $oimage + * @param File $file * @param int $bitfield new rev_deleted bitfield value */ - function updateOldFiles( $oimage, $bitfield ) { + function updateOldFiles( $file, $bitfield ) { $this->dbw->update( 'oldimage', array( 'oi_deleted' => $bitfield ), - array( 'oi_archive_name' => $oimage->archive_name ), + array( 'oi_name' => $file->getName(), + 'oi_timestamp' => $file->getTimestamp() ), __METHOD__ ); } @@ -1295,7 +1301,8 @@ class RevisionDeleter { $this->dbw->update( 'recentchanges', array( 'rc_deleted' => $bitfield, 'rc_patrolled' => 1 ), - array( 'rc_this_oldid' => $rev->getId() ), + array( 'rc_this_oldid' => $rev->getId(), + 'rc_timestamp' => $this->dbw->timestamp( $rev->getTimestamp() ) ), __METHOD__ ); }