From 4806ab95cac63477cbc08cee13f6ccc6d548dad0 Mon Sep 17 00:00:00 2001 From: GeoffreyT2000 Date: Thu, 8 Feb 2018 17:22:23 -0800 Subject: [PATCH] Use log_page as the rc_cur_id for log entries in rebuildrecentchanges.php Using the log_page field as the rc_cur_id would make looking in the page table for the page_id entirely redundant. Bug: T186840 Change-Id: I8b013f89749a94f9c795f29a78535dcf33112905 --- maintenance/rebuildrecentchanges.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index 903cd409c9..45bb6deb24 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -277,17 +277,17 @@ class RebuildRecentchanges extends Maintenance { array_keys( $wgFilterLogTypes ), [ 'create' ] ); - $this->output( "Loading from user, page, and logging tables...\n" ); + $this->output( "Loading from user and logging tables...\n" ); $commentQuery = $commentStore->getJoin( 'log_comment' ); $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' ); $res = $dbw->select( - [ 'logging', 'page' ] + $commentQuery['tables'] + $actorQuery['tables'], + [ 'logging' ] + $commentQuery['tables'] + $actorQuery['tables'], [ 'log_timestamp', 'log_namespace', 'log_title', - 'page_id', + 'log_page', 'log_type', 'log_action', 'log_id', @@ -302,10 +302,7 @@ class RebuildRecentchanges extends Maintenance { ], __METHOD__, [ 'ORDER BY' => 'log_timestamp DESC' ], - [ - 'page' => - [ 'LEFT JOIN', [ 'log_namespace=page_namespace', 'log_title=page_title' ] ] - ] + $commentQuery['joins'] + $actorQuery['joins'] + $commentQuery['joins'] + $actorQuery['joins'] ); $field = $dbw->fieldInfo( 'recentchanges', 'rc_cur_id' ); @@ -330,8 +327,8 @@ class RebuildRecentchanges extends Maintenance { 'rc_type' => RC_LOG, 'rc_source' => RecentChange::SRC_LOG, 'rc_cur_id' => $field->isNullable() - ? $row->page_id - : (int)$row->page_id, // NULL => 0, + ? $row->log_page + : (int)$row->log_page, // NULL => 0, 'rc_log_type' => $row->log_type, 'rc_log_action' => $row->log_action, 'rc_logid' => $row->log_id, -- 2.20.1