From: Domas Mituzas Date: Sat, 12 Nov 2005 09:53:16 +0000 (+0000) Subject: "I LOVE YOU AVAR" type of commit X-Git-Tag: 1.6.0~1195 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=bf4605e41a23fa042c4eb7aceccc29982927ad3c;p=lhc%2Fweb%2Fwiklou.git "I LOVE YOU AVAR" type of commit a) Use indexes for joins b) Choose proper column for IS NULL, in order to avoid row fetches and work on index only c) PROFIT!!! (a query faster by a factor of tens of thousands... ) --- diff --git a/includes/SpecialWantedcategories.php b/includes/SpecialWantedcategories.php index 7a35703bba..a47576f27f 100644 --- a/includes/SpecialWantedcategories.php +++ b/includes/SpecialWantedcategories.php @@ -35,8 +35,8 @@ class WantedCategoriesPage extends QueryPage { cl_to as title, COUNT(*) as value FROM $categorylinks - LEFT JOIN $page ON cl_to = page_title - WHERE page_len IS NULL + LEFT JOIN $page ON cl_to = page_title AND page_namespace = ". NS_CATEGORY ." + WHERE page_title IS NULL GROUP BY cl_to "; }