Make Special:MIMESearch a non-expensive special page.
authorBrian Wolff <bawolff+wn@gmail.com>
Fri, 7 Jun 2013 17:29:56 +0000 (14:29 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Thu, 25 Jul 2013 03:05:09 +0000 (00:05 -0300)
commit3342fafb4839a27b0be3a6e02149e1accf63cc87
treedd7da779fa1a7ff496ce95c11002a0ed9c867780
parent087dc60bdfb4b08829d666a96726b52afc4a471b
Make Special:MIMESearch a non-expensive special page.

This tries to use the index on (img_media_type, img_major_mime, img_minor_mime).
This is not the ideal index for this purpose (due to starting with
img_media_type, and not having an img_name at the end). However it
seems usable due to the low number of values img_media_type can have.
Thus we can just specify all values, and the index will get used
as a range index.

The only potentially problematic thing I see is that it uses
LIMIT X,Y for the offsets (due to being a query page) which can
be expensive on big offsets. If that's an issue, we could limit
the number of results to be at most $wgQueryCacheLimit or something.

Note: There's some discussion on the bug rather negative to this
special page in general. While I agree with much of the criticism,
I still think this special page can be useful, and if it can be
made efficient without needing to modify the indicies, we might
as well.

Bug: 13438
Change-Id: I88826ae7bff0812374157e596f86a19b248220e1
RELEASE-NOTES-1.22
includes/QueryPage.php
includes/specials/SpecialMIMEsearch.php