From 00d4f3c482978b3cc82e5394655d5f7ea8aba5f3 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 7 Jul 2008 13:08:03 +0000 Subject: [PATCH] Killing filesort in prop={links,templatelinks} when {pl,tl}namespace isn't set. --- includes/api/ApiQueryLinks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php index 69805411c4..73a2ad8a79 100644 --- a/includes/api/ApiQueryLinks.php +++ b/includes/api/ApiQueryLinks.php @@ -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"); -- 2.20.1