Page MenuHomePhabricator

Add *_direct_link to imagelinks and templatelinks
Closed, DeclinedPublic

Description

Add il_direct_link to imagelinks and tl_direct_link to templates links to allow Special:WhatLinksHere and file pages to skip items that are not actual links on the page (like file links to redirects).

Event Timeline

Change 674348 had a related patch set uploaded (by BrandonXLF; owner: BrandonXLF):
[mediawiki/core@master] Add *_direct_link to imagelinks and templatelinks

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

BrandonXLF renamed this task from Add *_direct_from to imagelinks and templatelinks to Add *_direct_link to imagelinks and templatelinks.Mar 23 2021, 2:32 PM

I've left a -2 on the patch until this change is agreed to by DBAs

What are you trying to achieve with this change? I am especially concerned with adding more things to the already massive templatelinks table, which is now one of the top3 tables in size.

Please don't do this.

  • *links tables are massive and messy and bound to break wikis (specially commons and enwiki), pagelinks table is already bigger than revision table in enwiki. We should normalize these tables first (T222224: RFC: Normalize MediaWiki link tables)
  • This seems to be a bug/feature in the interface, Whatlinkshere can simply strip out duplicate entries when showing to users (either through SELECT DISTINCT or other ways) instead of adding a new column on a table with billions of rows and adding potentially tens of gigabytes of data to innodb buffer pool and other places.

That mostly works, but there are still issues if it's done that way. Let's say template A redirects to template B. If page 1 transcludes template A and template B, but page 2 just transcludes template A, they will appear the same in the templatelinks table, making it impossible for WhatLinksHere to correctly display links.

I am going to close this per: T278236#6940822
In summary, *link tables do require lots of work pre work before we can start adding more things to them.

Please re-open if you think this needs to stay open.