* Make revisiondelete queries not suck (many where index misses)
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 4 Apr 2008 04:15:21 +0000 (04:15 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 4 Apr 2008 04:15:21 +0000 (04:15 +0000)
* Document var

includes/LogEventsList.php
includes/SpecialRevisiondelete.php

index 5aac654..c7d6938 100644 (file)
@@ -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;
index 5280f02..eeaa957 100644 (file)
@@ -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__ );
        }