Allow mime search of api works in miser mode
Open, LowestPublic

Description

Since gerrit 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 76954.

Created a bug to keep this in mind, maybe some days this is possible.


Version: 1.22.0
Severity: enhancement

Details

Reference
bz52415
bzimport raised the priority of this task from to Lowest.
bzimport set Reference to bz52415.
bzimport added a subscriber: Unknown Object (MLST).

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.

Anomie added a comment.Aug 1 2013, 8:59 PM

(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.

Anomie added a comment.Aug 2 2013, 2:44 PM

(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

Reedy added a comment.Aug 2 2013, 5:38 PM

This feels deja vu...

Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Feb 19 2015, 6:57 PM