API: Remove index forcing in ApiQueryRecentChanges
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 12 Jul 2016 15:29:04 +0000 (11:29 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 12 Jul 2016 15:31:55 +0000 (11:31 -0400)
It's preventing better indexes from being chosen; hopefully removing it
doesn't cause worse indexes to be chosen anymore in other cases.

Bug: T140108
Change-Id: Iee480e221dc26f89e8583be5f26c6571b240e390

includes/api/ApiQueryRecentChanges.php

index f0fd2f4..63c95d3 100644 (file)
@@ -150,7 +150,6 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                 *              AND rc_timestamp < $end AND rc_namespace = $namespace
                 */
                $this->addTables( 'recentchanges' );
-               $index = [ 'recentchanges' => 'rc_timestamp' ]; // May change
                $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
 
                if ( !is_null( $params['continue'] ) ) {
@@ -246,7 +245,6 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
 
                if ( !is_null( $params['user'] ) ) {
                        $this->addWhereFld( 'rc_user_text', $params['user'] );
-                       $index['recentchanges'] = 'rc_user_text';
                }
 
                if ( !is_null( $params['excludeuser'] ) ) {
@@ -362,7 +360,6 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
 
                $this->token = $params['token'];
                $this->addOption( 'LIMIT', $params['limit'] + 1 );
-               $this->addOption( 'USE INDEX', $index );
 
                $count = 0;
                /* Perform the actual query. */