Fixed slow query in LocalFileDeleteBatch::getHashes()
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 22 Apr 2014 05:58:36 +0000 (22:58 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 22 Apr 2014 05:58:42 +0000 (22:58 -0700)
* All the old files will have the oi_name of the $file

bug: 62360
Change-Id: Ie3aeee44a7ec1ef4cad0c0fcde9b7d0dba003da2

includes/filerepo/file/LocalFile.php

index 1832f21..dbf6918 100644 (file)
@@ -2002,7 +2002,8 @@ class LocalFileDeleteBatch {
                        $res = $dbw->select(
                                'oldimage',
                                array( 'oi_archive_name', 'oi_sha1' ),
-                               array( 'oi_archive_name' => array_keys( $oldRels ) ),
+                               array( 'oi_archive_name' => array_keys( $oldRels ),
+                                       'oi_name' => $this->file->getName() ), // performance
                                __METHOD__
                        );