From: Domas Mituzas Date: Tue, 8 May 2007 15:14:33 +0000 (+0000) Subject: enforce join order for whatlinkshere queries - avoid filesorts at a cost of scanning... X-Git-Tag: 1.31.0-rc.0~53020 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=a52a3acd8bfcc25913cdcbf4bf4781dcd72b5aa7;p=lhc%2Fweb%2Fwiklou.git enforce join order for whatlinkshere queries - avoid filesorts at a cost of scanning more records for damn namespace selector --- diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index d84326a8ca..a11e9d42c9 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -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' );