From: Sam Reed Date: Fri, 14 Jan 2011 21:24:42 +0000 (+0000) Subject: Remove ancient comment, collapse if, move USE INDEX into if further down doing the... X-Git-Tag: 1.31.0-rc.0~32537 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=d6c5ef7a5dec68105b03ff700faf27d98d5e804e;p=lhc%2Fweb%2Fwiklou.git Remove ancient comment, collapse if, move USE INDEX into if further down doing the exact same --- diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index 0778f38cb6..45268aed1a 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -92,13 +92,6 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { $this->addFieldsIf( 'cl_type', $fld_type ); $this->addTables( array( 'page', 'categorylinks' ) ); // must be in this order for 'USE INDEX' - // Not needed after bug 10280 is applied to servers - if ( $params['sort'] == 'timestamp' ) { - $this->addOption( 'USE INDEX', 'cl_timestamp' ); - } else { - $this->addOption( 'USE INDEX', 'cl_sortkey' ); - } - $this->addWhere( 'cl_from=page_id' ); $this->setContinuation( $params['continue'], $params['dir'] ); $this->addWhereFld( 'cl_to', $categoryTitle->getDBkey() ); @@ -122,6 +115,8 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { $dir, $params['start'], $params['end'] ); + + $this->addOption( 'USE INDEX', 'cl_timestamp' ); } else { $this->addWhereRange( 'cl_sortkey', $dir, @@ -129,6 +124,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { $params['endsortkey'] ); $this->addWhereRange( 'cl_from', $dir, null, null ); + $this->addOption( 'USE INDEX', 'cl_sortkey' ); } $limit = $params['limit'];