GWicke has uploaded a new change for review.
https://gerrit.wikimedia.org/r/199165
Change subject: Don't count all back links
......................................................................
Don't count all back links
Use the getNumLinks() LIMIT parameter to avoid counting all backlinks, which
can be an expensive operation with million of backlinks.
Change-Id: I50b3eff7b7c85256e85de230118f605971dd27b5
---
M RestbaseUpdateJob.php
1 file changed, 6 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RestBaseUpdateJobs
refs/changes/65/199165/1
diff --git a/RestbaseUpdateJob.php b/RestbaseUpdateJob.php
index fc15115..e7a0a95 100644
--- a/RestbaseUpdateJob.php
+++ b/RestbaseUpdateJob.php
@@ -139,7 +139,12 @@
// a root partition job
if ( !isset( $this->params['range'] ) ) {
// how many backlinks does this title
have ?
- $noLinks =
$this->getTitle()->getBacklinkCache()->getNumLinks( $this->params['table'] );
+ $backlinkCache =
$this->getTitle()->getBacklinkCache();
+ $noLinks = $backlinkCache->getNumLinks(
+ $this->params['table'],
+ // No need to count all
+ $wgRestbaseNoMinThrottle + 1
+ );
if( $noLinks <=
$wgRestbaseNoMinThrottle ) {
// there is only a small number
of jobs, so batch them all together
$noJobs = $noLinks;
--
To view, visit https://gerrit.wikimedia.org/r/199165
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I50b3eff7b7c85256e85de230118f605971dd27b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RestBaseUpdateJobs
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits