Page MenuHomePhabricator

ItemImages::loadImages() must use a batched query
Closed, ResolvedPublic

Description

...for performance reason. This is a blocker for production usage.

Event Timeline

MaxSem raised the priority of this task from to Unbreak Now!.
MaxSem updated the task description. (Show Details)
MaxSem added a project: Gather.
MaxSem subscribed.

Change 191584 had a related patch set uploaded (by Florianschmidtwelzow):
Hygiene: Use one query to get all page images

https://gerrit.wikimedia.org/r/191584

Patch-For-Review

Patch seems good, but there is a method that does exactly that on PageImages but it is private... :( We should probably modify push to that extension to have the method public (i don't remember the exact name, it was something like getArticleIds)

https://github.com/wikimedia/mediawiki-extensions-PageImages/blob/master/PageImages.body.php#L270-L289

Result example:

"1": {
     "pageid": 1,
     "ns": 0,
     "title": "Alan Smithee"
 },
 "20": {
     "pageid": 20,
     "ns": 0,
     "title": "Liste von Autoren/G"
 },
 "80": {
     "pageid": 80,
     "ns": 0,
     "title": "Muhammad ibn Musa al-Chwarizmi"
 },
 "214": {
     "pageid": 214,
     "ns": 0,
     "title": "Alfred Nobel",
     "pageimage": "AlfredNobel_adjusted.jpg"
 }

@MaxSem: would you be ok, if this function is public?

Mmm, ideally, it should be rewritten first to not use that lazy internal API call:)

to not use that lazy internal API call:)

if i understand @Jhernandez correct, he is fine with the change in Gather, can you take a look if we just reuse this part of code? :D Thanks!

Change 191584 merged by jenkins-bot:
Hygiene: Use one query to get all page images

https://gerrit.wikimedia.org/r/191584

Jhernandez claimed this task.

@Florian's patch has been merged, so I'm closing this since it has been solved.