Killing filesort in prop={links,templatelinks} when {pl,tl}namespace isn't set.
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 7 Jul 2008 13:08:03 +0000 (13:08 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 7 Jul 2008 13:08:03 +0000 (13:08 +0000)
includes/api/ApiQueryLinks.php

index 6980541..73a2ad8 100644 (file)
@@ -93,7 +93,8 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
                $order = array();
                if(count($this->getPageSet()->getGoodTitles()) != 1)
                        $order[] = "{$this->prefix}_from";
-               // pl_namespace is always constant
+               if(!isset($params['namespace']))
+                       $order[] = "{$this->prefix}_namespace";
                $order[] = "{$this->prefix}_title";
                $this->addOption('ORDER BY', implode(", ", $order));
                $this->addOption('USE INDEX', "{$this->prefix}_from");