Avoid per-title page_lang DB queries HTMLCacheUpdateJob
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 14 Sep 2017 13:43:53 +0000 (15:43 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Wed, 20 Sep 2017 16:48:42 +0000 (16:48 +0000)
Change-Id: Ie2fa64400f05d90e615bd8ff26225e197605d244

includes/jobqueue/jobs/HTMLCacheUpdateJob.php

index 0aa33ca..e8edab5 100644 (file)
@@ -103,7 +103,7 @@ class HTMLCacheUpdateJob extends Job {
         * @param array $pages Map of (page ID => (namespace, DB key)) entries
         */
        protected function invalidateTitles( array $pages ) {
-               global $wgUpdateRowsPerQuery, $wgUseFileCache;
+               global $wgUpdateRowsPerQuery, $wgUseFileCache, $wgPageLanguageUseDB;
 
                // Get all page IDs in this query into an array
                $pageIds = array_keys( $pages );
@@ -145,7 +145,10 @@ class HTMLCacheUpdateJob extends Job {
                // Get the list of affected pages (races only mean something else did the purge)
                $titleArray = TitleArray::newFromResult( $dbw->select(
                        'page',
-                       [ 'page_namespace', 'page_title' ],
+                       array_merge(
+                               [ 'page_namespace', 'page_title' ],
+                               $wgPageLanguageUseDB ? [ 'page_lang' ] : []
+                       ),
                        [ 'page_id' => $pageIds, 'page_touched' => $dbw->timestamp( $touchTimestamp ) ],
                        __METHOD__
                ) );