Last modified: 2013-08-02 17:38:06 UTC
Since Gerrit change #67468 it is possible to use [[Special:MIMESearch]] in miser mode. It would be nice to have it also work for api. list=allimages has a aimime= param, but that is disabled in miser mode due to bad performance on the database. You can also found some comments about the performance in Gerrit change #76954. Created a bug to keep this in mind, maybe some days this is possible.
OK, so my apologies for being a bit under-experienced in the MimeMagic field of MediaWiki (I don't do much upload work), but I recently discovered the MimeMagic::findMediaType() function. Using this function should allow complete avoidance of using a range index match since we can now just specify all columns exactly. If we were to add an index on (img_media_type, img_mime_major, img_mime_minor, img_name) (forgive me if those column names aren't accurate), it should make an efficient query on this very much possible. Also, it would allow sorting in Special:MIMESearch as well, which would be helpful.
(In reply to comment #1) > OK, so my apologies for being a bit under-experienced in the MimeMagic field > of > MediaWiki (I don't do much upload work), but I recently discovered the > MimeMagic::findMediaType() function. Using this function should allow > complete > avoidance of using a range index match since we can now just specify all > columns exactly. If that can be done, then it might just work. But are there any old rows identified as 'UNKNOWN' where the type is now known? > If we were to add an index on (img_media_type, img_mime_major, > img_mime_minor, > img_name) (forgive me if those column names aren't accurate), it should make > an > efficient query on this very much possible. Also, it would allow sorting in > Special:MIMESearch as well, which would be helpful. You can test it now, if you have MySQL with InnoDB, since the primary key is img_name. See bug 24782 comment 16 for details.
(In reply to comment #2) > If that can be done, then it might just work. But are there any old rows > identified as 'UNKNOWN' where the type is now known? Hmm, how would I find this out? > You can test it now, if you have MySQL with InnoDB, since the primary key is > img_name. See bug 24782 comment 16 for details. Interesting. I'll see if I can check this on my database later tonight.
(In reply to comment #3) > (In reply to comment #2) > > If that can be done, then it might just work. But are there any old rows > > identified as 'UNKNOWN' where the type is now known? > > Hmm, how would I find this out? Easiest way would be to get an account on Tool Labs[1] if you don't already have one, and look in the replicated databases. [1]: https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/Help
This feels deja vu...