http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90862
Revision: 90862
Author: aaron
Date: 2011-06-26 23:32:46 +0000 (Sun, 26 Jun 2011)
Log Message:
-----------
Restore new_name_timestamp index usage in UNION. Since r51907, there was no
reason for doing the UNION. Fixed "is_null( $namespace )" checks, broken
probably since FormOptions was used here (NULL value not saved for 'namespace',
left to default, which is ''). Added check for 'associated namespaces' option.
Modified Paths:
--------------
trunk/phase3/includes/specials/SpecialRecentchanges.php
Modified: trunk/phase3/includes/specials/SpecialRecentchanges.php
===================================================================
--- trunk/phase3/includes/specials/SpecialRecentchanges.php 2011-06-26
23:25:50 UTC (rev 90861)
+++ trunk/phase3/includes/specials/SpecialRecentchanges.php 2011-06-26
23:32:46 UTC (rev 90862)
@@ -365,6 +365,7 @@
$limit = $opts['limit'];
$namespace = $opts['namespace'];
$invert = $opts['invert'];
+ $associated = $opts['associated'];
$fields = array( $dbr->tableName( 'recentchanges' ) . '.*' );
// all rc columns
// JOIN on watchlist for users
@@ -397,11 +398,11 @@
// Don't use the new_namespace_time timestamp index if:
// (a) "All namespaces" selected
- // (b) We want all pages NOT in a certain namespaces (inverted)
+ // (b) We want pages in more than one namespace
(inverted/associated)
// (c) There is a tag to filter on (use tag index instead)
// (d) UNION + sort/limit is not an option for the DBMS
- if( is_null( $namespace )
- || ( $invert && !is_null( $namespace ) )
+ if( $namespace === ''
+ || ( $invert || $associated )
|| $opts['tagfilter'] != ''
|| !$dbr->unionSupportsOrderAndLimit() )
{
@@ -420,7 +421,7 @@
array(
'ORDER BY' => 'rc_timestamp DESC',
'LIMIT' => $limit,
- 'USE INDEX' => array( 'recentchanges'
=> 'rc_timestamp' )
+ 'USE INDEX' => array( 'recentchanges'
=> 'new_name_timestamp' )
),
$join_conds
);
@@ -433,7 +434,7 @@
array(
'ORDER BY' => 'rc_timestamp DESC',
'LIMIT' => $limit,
- 'USE INDEX' => array( 'recentchanges'
=> 'rc_timestamp' )
+ 'USE INDEX' => array( 'recentchanges'
=> 'new_name_timestamp' )
),
$join_conds
);
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs