remove forced index causing full index scans
authorSean Pringle <springle@wikimedia.org>
Fri, 20 Dec 2013 07:18:07 +0000 (17:18 +1000)
committerSean Pringle <springle@wikimedia.org>
Fri, 20 Dec 2013 07:19:14 +0000 (17:19 +1000)
bug 57285

Change-Id: I2a41553c60de53b156fda01faa89af7bdd29d065

includes/api/ApiQueryRandom.php
includes/specials/SpecialRandompage.php

index e990386..0d54ffe 100644 (file)
@@ -60,7 +60,6 @@ class ApiQueryRandom extends ApiQueryGeneratorBase {
                $this->addWhereFld( 'page_namespace', $namespace );
                $this->addWhereRange( 'page_random', 'newer', $randstr, null );
                $this->addWhereFld( 'page_is_redirect', $redirect );
-               $this->addOption( 'USE INDEX', 'page_random' );
                if ( is_null( $resultPageSet ) ) {
                        $this->addFields( array( 'page_id', 'page_title', 'page_namespace' ) );
                } else {
index c94d2b3..086193e 100644 (file)
@@ -144,7 +144,6 @@ class RandomPage extends SpecialPage {
                        ), $this->extra ),
                        'options' => array(
                                'ORDER BY' => 'page_random',
-                               'USE INDEX' => 'page_random',
                                'LIMIT' => 1,
                        ),
                        'join_conds' => array()