From c4a9fb65bdef968262d7a35308b0d2fe762e8635 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 15 Apr 2019 10:41:03 -0400 Subject: [PATCH] ContibsPager: Fix slow query with actor migration read-new mode The change in I1678f7ec broke the workaround in I992aa50f by adding the rev_id column to the ORDER BY clause. We need to extend the aliasing to rev_id => revactor_rev to re-fix it. Bug: T220991 Change-Id: I62dc3803621da982e526d7402ab8e7b08f8336bc --- includes/specials/pagers/ContribsPager.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php index 10fcfc6e8a..44ecb6fb03 100644 --- a/includes/specials/pagers/ContribsPager.php +++ b/includes/specials/pagers/ContribsPager.php @@ -301,11 +301,12 @@ class ContribsPager extends RangeChronologicalPager { if ( isset( $conds['orconds']['actor'] ) ) { // @todo: This will need changing when revision_comment_temp goes away $queryInfo['options']['USE INDEX']['temp_rev_user'] = 'actor_timestamp'; - // Alias 'rev_timestamp' => 'revactor_timestamp' so "ORDER BY rev_timestamp" is interpreted to - // use revactor_timestamp instead. + // Alias 'rev_timestamp' => 'revactor_timestamp' and 'rev_id' => 'revactor_rev' so + // "ORDER BY rev_timestamp, rev_id" is interpreted to use denormalized revision_actor_temp + // fields instead. $queryInfo['fields'] = array_merge( - array_diff( $queryInfo['fields'], [ 'rev_timestamp' ] ), - [ 'rev_timestamp' => 'revactor_timestamp' ] + array_diff( $queryInfo['fields'], [ 'rev_timestamp', 'rev_id' ] ), + [ 'rev_timestamp' => 'revactor_timestamp', 'rev_id' => 'revactor_rev' ] ); } else { $queryInfo['options']['USE INDEX']['revision'] = -- 2.20.1