r71173 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71172‎ | r71173 | r71174 >
Date:21:37, 16 August 2010
Author:simetrical
Status:ok
Tags:
Comment:
Save up to 200 queries per click in CategoryTree

Remember, people: if you use Titles that don't have all the proper
fields prefetched, LinkCache will fetch them for you, one by one.
Fetching page_id, page_len, page_is_latest, and page_latest will make
everything work without needless queries.
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -425,7 +425,9 @@
426426 $namespaces = $this->getOption( 'namespaces' );
427427
428428 $tables = array( 'page', 'categorylinks' );
429 - $fields = array( 'page_namespace', 'page_title', 'cl_to', 'cl_from' );
 429+ $fields = array( 'page_id', 'page_namespace', 'page_title',
 430+ 'page_is_redirect', 'page_len', 'page_latest', 'cl_to',
 431+ 'cl_from' );
430432 $where = array();
431433 $joins = array();
432434

Status & tagging log