"I LOVE YOU AVAR" type of commit
authorDomas Mituzas <midom@users.mediawiki.org>
Sat, 12 Nov 2005 09:53:16 +0000 (09:53 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Sat, 12 Nov 2005 09:53:16 +0000 (09:53 +0000)
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... )

includes/SpecialWantedcategories.php

index 7a35703..a47576f 100644 (file)
@@ -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
                        ";
        }