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

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

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.

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

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 claimed this task.

Change 176804 abandoned by Aude:
Use TermLookup in LinkBegin hook

Reason:
super outdated

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