From 183851b06bd6c52f3cae5375f433da720d410447 Mon Sep 17 00:00:00 2001
From: Pierre Schmitz <pierre@archlinux.de>
Date: Wed, 11 Oct 2006 18:12:39 +0000
Subject: MediaWiki 1.7.1 wiederhergestellt

---
 maintenance/archives/patch-mimesearch-indexes.sql | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 maintenance/archives/patch-mimesearch-indexes.sql

(limited to 'maintenance/archives/patch-mimesearch-indexes.sql')

diff --git a/maintenance/archives/patch-mimesearch-indexes.sql b/maintenance/archives/patch-mimesearch-indexes.sql
new file mode 100644
index 00000000..bd348c46
--- /dev/null
+++ b/maintenance/archives/patch-mimesearch-indexes.sql
@@ -0,0 +1,22 @@
+-- Add indexes to the mime types in image for use on Special:MIMEsearch,
+-- changes a query like
+--
+-- SELECT img_name FROM image WHERE img_major_mime = "image" AND img_minor_mime = "svg";
+-- from:
+-- +-------+------+---------------+------+---------+------+------+-------------+
+-- | table | type | possible_keys | key  | key_len | ref  | rows | Extra       |
+-- +-------+------+---------------+------+---------+------+------+-------------+
+-- | image | ALL  | NULL          | NULL |    NULL | NULL |  194 | Using where |
+-- +-------+------+---------------+------+---------+------+------+-------------+
+-- to:
+-- +-------+------+-------------------------------+----------------+---------+-------+------+-------------+
+-- | table | type | possible_keys                 | key            | key_len | ref   | rows | Extra       |
+-- +-------+------+-------------------------------+----------------+---------+-------+------+-------------+
+-- | image | ref  | img_major_mime,img_minor_mime | img_minor_mime |      32 | const |    4 | Using where |
+-- +-------+------+-------------------------------+----------------+---------+-------+------+-------------+
+
+ALTER TABLE /*$wgDBprefix*/image
+	ADD INDEX img_major_mime (img_major_mime);
+ALTER TABLE /*$wgDBprefix*/image
+	ADD INDEX img_minor_mime (img_minor_mime);
+
-- 
cgit v1.2.3-54-g00ecf

