r67176 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67175‎ | r67176 | r67177 >
Date:05:52, 1 June 2010
Author:midom
Status:ok
Tags:
Comment:
Avoid hitting cl_timestamp index (and huge filesorts), added by DPL...
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -419,13 +419,13 @@
420420 $namespaces = $this->getOption('namespaces');
421421
422422 if ( $inverse ) {
423 - $ctJoinCond = ' cl_to = cat.page_title AND cat.page_namespace = ' . NS_CATEGORY;
 423+ $ctJoinCond = ' ON cl_to = cat.page_title AND cat.page_namespace = ' . NS_CATEGORY;
424424 $ctWhere = ' cl_from = ' . $title->getArticleId();
425425 $ctJoin = ' RIGHT JOIN ';
426426 $nsmatch = '';
427427 }
428428 else {
429 - $ctJoinCond = ' cl_from = cat.page_id ';
 429+ $ctJoinCond = ' FORCE INDEX (cl_sortkey) ON cl_from = cat.page_id ';
430430 $ctWhere = ' cl_to = ' . $dbr->addQuotes( $title->getDBkey() );
431431 $ctJoin = ' JOIN ';
432432
@@ -467,7 +467,7 @@
468468 $transFields
469469 $countFields
470470 FROM $page as cat
471 - $ctJoin $categorylinks ON $ctJoinCond
 471+ $ctJoin $categorylinks $ctJoinCond
472472 $transJoin
473473 $countJoin
474474 WHERE $ctWhere

Follow-up revisions

RevisionCommit summaryAuthorDate
r80634CategoryTree: Force cl_sortkey index. This is a backport of the live hack com...catrope18:55, 20 January 2011

Status & tagging log