enforce join order for whatlinkshere queries - avoid filesorts at a cost of scanning...
authorDomas Mituzas <midom@users.mediawiki.org>
Tue, 8 May 2007 15:14:33 +0000 (15:14 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Tue, 8 May 2007 15:14:33 +0000 (15:14 +0000)
includes/SpecialWhatlinkshere.php

index d84326a..a11e9d4 100644 (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' );