Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use LinkBatch in AffectedPagesFinder
The AffectedPagesFinder needs the page ID for each affected title of a sitelink/title change, so use the LinkBatch class to load them in bulk, instead of potentially doing one database query per title later when we call getArticleID(). In theory, it’s possible that this actually increases the number of database queries. If all of the titles were already in the link cache, then previously no database query would have been made; however, LinkBatch always queries for titles even if they are already in the link cache (T266494), so at least one database query is always made (plus potentially one more for the gender cache, if applicable – though that should be rare, since only user page titles need gender information and those pages generally aren’t linked to items). However, I see no reason to assume the pages would already be in the link cache at this point, so I don’t expect this to actually increase the number of queries. While we’re already touching the class and adding dependency injection (for the link batch factory), also inject the logger and declare strict types. Bug: T266499 Change-Id: I73d6b87dbde36b9cc076ee45c34ed84223336761
- Loading branch information
1 parent
acf74d9
commit 56685d6
Showing
4 changed files
with
48 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters