From: Tim Starling Date: Fri, 21 Apr 2006 03:35:01 +0000 (+0000) Subject: Removed extra GROUP BY terms introduced in revision 13603, pending review, following... X-Git-Tag: 1.31.0-rc.0~57412 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=3afcc87e404286c13f182c435f5a188df63014ff;p=lhc%2Fweb%2Fwiklou.git Removed extra GROUP BY terms introduced in revision 13603, pending review, following a total DoS of enwiki due to the slow Special:Listusers query. Changing from "GROUP BY user_name" to "GROUP BY user_name,user_id" increaed the time for a LIMIT 50,50 query from 0.01 seconds to 33 seconds. --- diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index 3bf16e5b90..17cc923ee1 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -135,7 +135,7 @@ class ListUsersPage extends QueryPage { "FROM $user ". "LEFT JOIN $user_groups ON user_id=ug_user " . $this->userQueryWhere( $dbr ) . - " GROUP BY user_name, user_id"; + " GROUP BY user_name"; return $sql; } diff --git a/includes/SpecialMostcategories.php b/includes/SpecialMostcategories.php index 0deaac9da6..17dbb5d60a 100644 --- a/includes/SpecialMostcategories.php +++ b/includes/SpecialMostcategories.php @@ -34,7 +34,7 @@ class MostcategoriesPage extends QueryPage { FROM $categorylinks LEFT JOIN $page ON cl_from = page_id WHERE page_namespace = " . NS_MAIN . " - GROUP BY cl_from, page_namespace, page_title + GROUP BY cl_from HAVING COUNT(*) > 1 "; } diff --git a/includes/SpecialMostlinked.php b/includes/SpecialMostlinked.php index 57471742d9..6b518606bb 100644 --- a/includes/SpecialMostlinked.php +++ b/includes/SpecialMostlinked.php @@ -37,7 +37,7 @@ class MostlinkedPage extends QueryPage { page_namespace FROM $pagelinks LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title - GROUP BY pl_namespace,pl_title,page_namespace + GROUP BY pl_namespace,pl_title HAVING COUNT(*) > 1"; } diff --git a/includes/SpecialMostrevisions.php b/includes/SpecialMostrevisions.php index 46c66ec47a..6bc807e4cf 100644 --- a/includes/SpecialMostrevisions.php +++ b/includes/SpecialMostrevisions.php @@ -36,7 +36,7 @@ class MostrevisionsPage extends QueryPage { FROM $revision LEFT JOIN $page ON page_id = rev_page WHERE page_namespace = " . NS_MAIN . " - GROUP BY rev_page, page_namespace, page_title + GROUP BY rev_page HAVING COUNT(*) > 1 "; }