Remove problem forced index
authorSean Pringle <springle@wikimedia.org>
Tue, 10 Dec 2013 06:20:33 +0000 (16:20 +1000)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 10 Dec 2013 06:38:36 +0000 (06:38 +0000)
bug: 58256
Change-Id: I48484b39f99d92f51e531324870236b00b481553

includes/specials/SpecialNewpages.php

index 43d4855..006510d 100644 (file)
@@ -524,15 +524,14 @@ class NewPagesPager extends ReverseChronologicalPager {
                $username = $this->opts->getValue( 'username' );
                $user = Title::makeTitleSafe( NS_USER, $username );
 
+               $rcIndexes = array();
+
                if ( $namespace !== false ) {
                        if ( $this->opts->getValue( 'invert' ) ) {
                                $conds[] = 'rc_namespace != ' . $this->mDb->addQuotes( $namespace );
                        } else {
                                $conds['rc_namespace'] = $namespace;
                        }
-                       $rcIndexes = array( 'new_name_timestamp' );
-               } else {
-                       $rcIndexes = array( 'rc_timestamp' );
                }
 
                # $wgEnableNewpagesUserFilter - temp WMF hack
@@ -572,11 +571,17 @@ class NewPagesPager extends ReverseChronologicalPager {
                wfRunHooks( 'SpecialNewpagesConditions',
                        array( &$this, $this->opts, &$conds, &$tables, &$fields, &$join_conds ) );
 
+               $options = array();
+
+               if ( $rcIndexes ) {
+                       $options = array( 'USE INDEX' => array( 'recentchanges' => $rcIndexes ) );
+               }
+
                $info = array(
                        'tables' => $tables,
                        'fields' => $fields,
                        'conds' => $conds,
-                       'options' => array( 'USE INDEX' => array( 'recentchanges' => $rcIndexes ) ),
+                       'options' => $options,
                        'join_conds' => $join_conds
                );