enforce join order for whatlinkshere queries - avoid filesorts at a cost of scanning more records for damn namespace selector

This commit is contained in:
Domas Mituzas 2007-05-08 15:14:33 +00:00
parent 0be61ee338
commit a52a3acd8b

View file

@ -112,6 +112,11 @@ class WhatLinksHerePage {
// Read an extra row as an at-end check
$queryLimit = $limit + 1;
// enforce join order, sometimes namespace selector may
// trigger filesorts which are far less efficient than scanning many entries
$options[] = 'STRAIGHT_JOIN';
$options['LIMIT'] = $queryLimit;
$fields = array( 'page_id', 'page_namespace', 'page_title', 'page_is_redirect' );