Last modified: 2013-08-02 17:38:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54415, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52415 - Allow mime search of api works in miser mode
Allow mime search of api works in miser mode
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.22.0
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 22744
  Show dependency treegraph
 
Reported: 2013-08-01 19:49 UTC by Umherirrender
Modified: 2013-08-02 17:38 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2013-08-01 19:49:50 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.
Comment 1 Tyler Romeo 2013-08-01 19:59:14 UTC
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.
Comment 2 Brad Jorsch 2013-08-01 20:59:01 UTC
(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.
Comment 3 Tyler Romeo 2013-08-01 21:12:49 UTC
(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.
Comment 4 Brad Jorsch 2013-08-02 14:44:25 UTC
(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
Comment 5 Sam Reed (reedy) 2013-08-02 17:38:06 UTC
This feels deja vu...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links