jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/349424 )
Change subject: Use smaller batches in TermSqlIndex::getTermsOfEntities ...................................................................... Use smaller batches in TermSqlIndex::getTermsOfEntities The batch size was suggested by the DBA. Bug: T163544 Change-Id: I983f2a51d79e913308f1730a3b4b2cb014cf0461 --- M lib/includes/Store/Sql/TermSqlIndex.php 1 file changed, 13 insertions(+), 1 deletion(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/lib/includes/Store/Sql/TermSqlIndex.php b/lib/includes/Store/Sql/TermSqlIndex.php index 32e8f6a..7a1b5ce 100644 --- a/lib/includes/Store/Sql/TermSqlIndex.php +++ b/lib/includes/Store/Sql/TermSqlIndex.php @@ -462,7 +462,19 @@ $this->assertEntityIdFromRightRepository( $id ); } - return $this->fetchTerms( $entityIds, $termTypes, $languageCodes ); + // Fetch up to 9 (as suggested by the DBA) terms each time: + // https://phabricator.wikimedia.org/T163544#3201562 + $entityIdBatches = array_chunk( $entityIds, 9 ); + $terms = []; + + foreach ( $entityIdBatches as $entityIdBatch ) { + $terms = array_merge( + $terms, + $this->fetchTerms( $entityIdBatch, $termTypes, $languageCodes ) + ); + } + + return $terms; } /** -- To view, visit https://gerrit.wikimedia.org/r/349424 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I983f2a51d79e913308f1730a3b4b2cb014cf0461 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo man <h...@online.de> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits