Page MenuHomePhabricator

Change existing indexes to significantly increase query performance
Closed, ResolvedPublic

Description

To substantially improve the performance of the queries that retrieve
backlink/template/image information, I would like to propose an index change to
these tables:

pagelinks: pl_namespace index: add pl_from
templatelinks: tl_namespace index: add tl_from
imagelinks: il_to index: add il_from

The additional field will allow multi-page queries to limit results and have an
easy way to continue the query without using filesort.

Additionally, I suspect that because the *_from fields are needed in the output,
having it as part of the index removes the need to actually read the table, but
rather MySQL will get all fields from the index itself. Since every “what points
to X / where is X embedded” query uses the *_from field, it would be of benefit
as well.


Version: 1.7.x
Severity: enhancement
OS: Windows XP
Platform: PC

Details

Reference
bz6440

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:17 PM
bzimport set Reference to bz6440.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

These all appear to have been added some time ago.

Please confirm these have been applied to the mediawiki servers. The code has
been checked in a while back.