Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -293,22 +293,20 @@ |
294 | 294 | // Tag stuff. |
295 | 295 | $fields = array(); |
296 | 296 | // Fields are * in this case, so let the function modify an empty array to keep it happy. |
297 | | - ChangeTags::modifyDisplayQuery( $tables, |
298 | | - $fields, |
299 | | - $conds, |
300 | | - $join_conds, |
301 | | - $query_options, |
302 | | - $opts['tagfilter'] |
303 | | - ); |
| 297 | + ChangeTags::modifyDisplayQuery( |
| 298 | + $tables, $fields, $conds, $join_conds, $query_options, $opts['tagfilter'] |
| 299 | + ); |
304 | 300 | |
305 | 301 | wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) ); |
306 | 302 | |
307 | | - // Is there either one namespace selected or excluded? |
308 | | - // Tag filtering also has a better index. |
309 | | - // Also, if this is "all" or main namespace, just use timestamp index. |
| 303 | + // Don't use the new_namespace_time timestamp index if: |
| 304 | + // (a) "All namespaces" selected |
| 305 | + // (b) We want all pages NOT in a certain namespaces (inverted) |
| 306 | + // (c) There is a tag to filter on (use tag index instead) |
| 307 | + // (d) UNION + sort/limit is not an option for the DBMS |
310 | 308 | if( is_null($namespace) |
311 | 309 | || $invert |
312 | | - || $opts['tagfilter'] |
| 310 | + || $opts['tagfilter'] != '' |
313 | 311 | || !$dbr->unionSupportsOrderAndLimit() ) |
314 | 312 | { |
315 | 313 | $res = $dbr->select( $tables, '*', $conds, __METHOD__, |