Page MenuHomePhabricator

pagelinks table could use additional index to speed up Special:MostLinkedPages
Closed, ResolvedPublicFeature

Description

The query used to generate Special:MostLinkedPages takes a very long time to run when the pagelinks table is large. (On my system, with 3 million rows, the query takes over 30 seconds, resulting in 502s to our load balancer.) Adding an index on (pl_namespace, pl_title) cuts that by around 60% (10 seconds on my system). It was suggested on IRC that this would also benefit Special:Whatlinkshere.


Version: 1.23.0
Severity: enhancement

Details

Reference
bz58418

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:18 AM
bzimport set Reference to bz58418.
bzimport added a subscriber: Unknown Object (MLST).

I believe Special:MostLinkedPages is disabled on Wikimedia wikis due to performance considerations. It would be nice to at least get an estimate of the cost involved (additional indices, space on disk, etc.) in making it work well enough for a large site. Of course the "pagelinks" tables are probably some of the largest.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:23 PM
Umherirrender subscribed.

It seems in the meantime such an index was added

INDEX pl_namespace (pl_namespace, pl_title, pl_from)

Not sure if that helps for the MostLinkedPages, but I would assume there is no more to optimise at the moment and see this task as fixed.