Don't load all languages just to check whether message is known.
[mediawiki.git] / maintenance / archives / patch-mimesearch-indexes.sql
blobbd348c46c26c99415638bdad440d2a5fb28d4c13
1 -- Add indexes to the mime types in image for use on Special:MIMEsearch,
2 -- changes a query like
3 --
4 -- SELECT img_name FROM image WHERE img_major_mime = "image" AND img_minor_mime = "svg";
5 -- from:
6 -- +-------+------+---------------+------+---------+------+------+-------------+
7 -- | table | type | possible_keys | key  | key_len | ref  | rows | Extra       |
8 -- +-------+------+---------------+------+---------+------+------+-------------+
9 -- | image | ALL  | NULL          | NULL |    NULL | NULL |  194 | Using where |
10 -- +-------+------+---------------+------+---------+------+------+-------------+
11 -- to:
12 -- +-------+------+-------------------------------+----------------+---------+-------+------+-------------+
13 -- | table | type | possible_keys                 | key            | key_len | ref   | rows | Extra       |
14 -- +-------+------+-------------------------------+----------------+---------+-------+------+-------------+
15 -- | image | ref  | img_major_mime,img_minor_mime | img_minor_mime |      32 | const |    4 | Using where |
16 -- +-------+------+-------------------------------+----------------+---------+-------+------+-------------+
18 ALTER TABLE /*$wgDBprefix*/image
19         ADD INDEX img_major_mime (img_major_mime);
20 ALTER TABLE /*$wgDBprefix*/image
21         ADD INDEX img_minor_mime (img_minor_mime);