From 2354da05389233189e85580f1312d40b22baaa76 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 21 Apr 2014 22:58:36 -0700 Subject: [PATCH] Fixed slow query in LocalFileDeleteBatch::getHashes() * All the old files will have the oi_name of the $file bug: 62360 Change-Id: Ie3aeee44a7ec1ef4cad0c0fcde9b7d0dba003da2 --- includes/filerepo/file/LocalFile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 1832f21edf..dbf6918c0c 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -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__ ); -- 2.20.1