Index: trunk/phase3/includes/CategoryPage.php |
— | — | @@ -247,18 +247,6 @@ |
248 | 248 | |
249 | 249 | $dbr = wfGetDB( DB_SLAVE, 'category' ); |
250 | 250 | |
251 | | - $tables = array( 'page', 'categorylinks', 'category' ); |
252 | | - $fields = array( 'page_title', 'page_namespace', 'page_len', |
253 | | - 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title', |
254 | | - 'cat_subcats', 'cat_pages', 'cat_files' ); |
255 | | - $conds = array( 'cl_to' => $this->title->getDBkey() ); |
256 | | - $opts = array( |
257 | | - 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey' ), |
258 | | - 'LIMIT' => $this->limit + 1, |
259 | | - ); |
260 | | - $joins = array( 'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ), |
261 | | - 'category' => array( 'LEFT JOIN', 'cat_title = page_title AND page_namespace = ' . NS_CATEGORY ) ); |
262 | | - |
263 | 251 | $this->nextPage = array( |
264 | 252 | 'page' => null, |
265 | 253 | 'subcat' => null, |
— | — | @@ -281,12 +269,21 @@ |
282 | 270 | } |
283 | 271 | |
284 | 272 | $res = $dbr->select( |
285 | | - $tables, |
286 | | - array_merge( $fields, array( 'cl_sortkey_prefix' ) ), |
287 | | - $conds + $extraConds, |
| 273 | + array( 'page', 'categorylinks', 'category' ), |
| 274 | + array( 'page_title', 'page_namespace', 'page_len', |
| 275 | + 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title', |
| 276 | + 'cat_subcats', 'cat_pages', 'cat_files', 'cl_sortkey_prefix' ), |
| 277 | + array( 'cl_to' => $this->title->getDBkey() ) + $extraConds, |
288 | 278 | __METHOD__, |
289 | | - $opts + array( 'ORDER BY' => $this->flip[$type] ? 'cl_sortkey DESC' : 'cl_sortkey' ), |
290 | | - $joins |
| 279 | + array( |
| 280 | + 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey' ), |
| 281 | + 'LIMIT' => $this->limit + 1, |
| 282 | + 'ORDER BY' => $this->flip[$type] ? 'cl_sortkey DESC' : 'cl_sortkey', |
| 283 | + ), |
| 284 | + array( |
| 285 | + 'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ), |
| 286 | + 'category' => array( 'LEFT JOIN', 'cat_title = page_title AND page_namespace = ' . NS_CATEGORY ) |
| 287 | + ) |
291 | 288 | ); |
292 | 289 | |
293 | 290 | $count = 0; |