Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -92,13 +92,6 @@ |
93 | 93 | $this->addFieldsIf( 'cl_type', $fld_type ); |
94 | 94 | $this->addTables( array( 'page', 'categorylinks' ) ); // must be in this order for 'USE INDEX' |
95 | 95 | |
96 | | - // Not needed after bug 10280 is applied to servers |
97 | | - if ( $params['sort'] == 'timestamp' ) { |
98 | | - $this->addOption( 'USE INDEX', 'cl_timestamp' ); |
99 | | - } else { |
100 | | - $this->addOption( 'USE INDEX', 'cl_sortkey' ); |
101 | | - } |
102 | | - |
103 | 96 | $this->addWhere( 'cl_from=page_id' ); |
104 | 97 | $this->setContinuation( $params['continue'], $params['dir'] ); |
105 | 98 | $this->addWhereFld( 'cl_to', $categoryTitle->getDBkey() ); |
— | — | @@ -122,6 +115,8 @@ |
123 | 116 | $dir, |
124 | 117 | $params['start'], |
125 | 118 | $params['end'] ); |
| 119 | + |
| 120 | + $this->addOption( 'USE INDEX', 'cl_timestamp' ); |
126 | 121 | } else { |
127 | 122 | $this->addWhereRange( 'cl_sortkey', |
128 | 123 | $dir, |
— | — | @@ -129,6 +124,7 @@ |
130 | 125 | $params['endsortkey'] ); |
131 | 126 | |
132 | 127 | $this->addWhereRange( 'cl_from', $dir, null, null ); |
| 128 | + $this->addOption( 'USE INDEX', 'cl_sortkey' ); |
133 | 129 | } |
134 | 130 | |
135 | 131 | $limit = $params['limit']; |