Page MenuHomePhabricator

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

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

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 2:13 AM
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.

(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

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:14 AM