Page MenuHomePhabricator

Improve IPContributionsPager query
Closed, ResolvedPublic

Description

The query run by IPContributoiunsPager can be improved in a couple of ways:

  • In revision mode, use RevisionStore::newSelectQueryBuilder instead of the deprecated RevisionStore::getQueryInfo method
  • Avoid unnecessary joins by using more fields on the cu_changes table, instead of their equivalents on the revision and archive tables (e.g. join to the comment table using cuc_comment_id rather than rev_comment_id, etc.)

Event Timeline

Change #1046733 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/CheckUser@master] IPContributionsPager: Improve revision query performance

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

Change #1046733 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] IPContributionsPager: Improve revision query performance

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

EXPLAIN queries using new and old code: P65795. @Tchanders does that look as you'd expect?

EXPLAIN queries using new and old code: P65795. @Tchanders does that look as you'd expect?

That looks right - everything's joining off cu_changes instead of revision where possible, and it's all indexed.

It's a hypothesized performance improvement (partly based on past experiences in CheckUser, like T354643), and I suppose difficult to prove until we have a large enough dataset of temporary accounts making lots of revisions from within one IP range.