Check forcing of page_timestamp revision index

Bug: T270033
Change-Id: I16fc273b14e7f4b00e8c31ec1ed7712149aafe37
This commit is contained in:
Ammarpad 2021-03-21 20:46:44 +01:00
parent ccd12544f1
commit 6a799ec9c5
3 changed files with 6 additions and 3 deletions

View file

@ -31,7 +31,6 @@ class AbuseFilterChangesList extends OldChangesList {
* @param string &$s
* @param RecentChange &$rc
* @param string[] &$classes
* @suppress PhanUndeclaredProperty for $rc->filterResult, which isn't a big deal
*/
public function insertExtra( &$s, &$rc, &$classes ) {
if ( (int)$rc->getAttribute( 'rc_deleted' ) !== 0 ) {

View file

@ -427,6 +427,11 @@ class LazyVariableComputer {
WANObjectCache::TTL_MINUTE,
function ( $oldValue, &$ttl, array &$setOpts ) use ( $title, $fname ) {
$dbr = $this->loadBalancer->getConnectionRef( DB_REPLICA );
// T270033 Index renaming
$revIndex = $dbr->indexExists( 'revision', 'page_timestamp', $fname )
? 'page_timestamp'
: 'rev_page_timestamp';
$setOpts += Database::getCacheSetOptions( $dbr );
// Get the last 100 edit authors with a trivial query (avoid T116557)
$revQuery = $this->revisionStore->getQueryInfo();
@ -444,7 +449,7 @@ class LazyVariableComputer {
[ 'ORDER BY' => 'rev_timestamp DESC, rev_id DESC',
'LIMIT' => 100,
// Force index per T116557
'USE INDEX' => [ 'revision' => 'page_timestamp' ],
'USE INDEX' => [ 'revision' => $revIndex ],
],
$revQuery['joins']
);

View file

@ -313,7 +313,6 @@ class AbuseFilterViewTestBatch extends AbuseFilterView {
if ( $result || $this->mShowNegative ) {
// Stash result in RC item
// @phan-suppress-next-line PhanUndeclaredProperty not a big deal
$rc->filterResult = $result;
$rc->counter = $counter++;
$output .= $changesList->recentChangesLine( $rc, false );