From: Brad Jorsch Date: Mon, 15 Apr 2019 14:41:03 +0000 (-0400) Subject: ContibsPager: Fix slow query with actor migration read-new mode X-Git-Tag: 1.34.0-rc.0~1972^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=c4a9fb65bdef968262d7a35308b0d2fe762e8635;p=lhc%2Fweb%2Fwiklou.git 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 --- 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'] =