Page MenuHomePhabricator

Do not load full entities when invoking LinkBegin hook
Closed, ResolvedPublic

Description

We load full entities for the onLinkBegin hook handler in Wikibase Repo in order to get a label.

e.g. for each item or property on Special:Allpages, we load the entity to get the label.

a term lookup, with caching and all, should be used instead.

LinkBegin is also used in places like Special:Watchlist (i think), so if someone has a gigantic watchlist, it probably will timeout.


Version: unspecified
Severity: normal
Whiteboard: u=dev c=backend p=8 s=2014-11-11

Details

Reference
bz70767
Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterUse TermLookup in LinkBegin hook
mediawiki/extensions/Wikibase : masterUse wb_terms table for label lookup.
mediawiki/extensions/Wikibase : masterUse TermLookup in LinkBegin hook.

Related Objects

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:56 AM
bzimport set Reference to bz70767.
bzimport added a subscriber: Unknown Object (MLST).
aude created this task.Sep 12 2014, 11:40 AM
aude added a comment.Nov 20 2014, 6:48 PM

part of the solution to this is to avoid using Linker whenever possible.

We are currently using Linker to format property id links in ClaimsView and SnakHtmlGenerator. Instead we should use an EntityIdHtmlLinkFormatter that makes use of an EntityInfoTermLookup / LabelLookup for this.

aude added a comment.Nov 20 2014, 6:49 PM

by not using Linker, we don't encounter this hook.

Change 176650 had a related patch set uploaded (by Daniel Kinzler):
Use wb_terms table for label lookup.

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

Patch-For-Review

daniel added a subscriber: daniel.Dec 1 2014, 2:01 PM

See T74309 for a draft of how label caching could work

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

Change 176804 had a related patch set uploaded (by Aude):
Use TermLookup in LinkBegin hook

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

Patch-For-Review

Change 176664 merged by jenkins-bot:
Use TermLookup in LinkBegin hook.

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

Change 176650 merged by jenkins-bot:
Use wb_terms table for label lookup.

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

daniel closed this task as Resolved.Dec 9 2014, 9:54 PM
daniel claimed this task.

Change 176804 abandoned by Aude:
Use TermLookup in LinkBegin hook

Reason:
super outdated

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