Split down patch-comment-table.sql
[lhc/web/wiklou.git] / maintenance / archives / patch-mimesearch-indexes.sql
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 -- +-------+------+-------------------------------+----------------+---------+-------+------+-------------+
17
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);
22