1 -- Add indexes to the mime types in image for use on Special:MIMEsearch,
2 -- changes a query like
4 -- SELECT img_name FROM image WHERE img_major_mime = "image" AND img_minor_mime = "svg";
6 -- +-------+------+---------------+------+---------+------+------+-------------+
7 -- | table | type | possible_keys | key | key_len | ref | rows | Extra |
8 -- +-------+------+---------------+------+---------+------+------+-------------+
9 -- | image | ALL | NULL | NULL | NULL | NULL | 194 | Using where |
10 -- +-------+------+---------------+------+---------+------+------+-------------+
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);