From: tjhunt Date: Mon, 13 Apr 2009 07:06:22 +0000 (+0000) Subject: filters: MDL-7336 tweak to improve SQL performance X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=16eaf7ed3519b3263f1a5066da465cbe56ab078f;p=moodle.git filters: MDL-7336 tweak to improve SQL performance --- diff --git a/lib/filterlib.php b/lib/filterlib.php index 46caf2e437..a0d5e2fb1b 100644 --- a/lib/filterlib.php +++ b/lib/filterlib.php @@ -631,8 +631,7 @@ function filter_get_active_in_context($context) { GROUP BY filter HAVING MAX(f.active * ctx.depth) > -MIN(f.active * ctx.depth) ORDER BY MAX(f.sortorder)) active - LEFT JOIN {filter_config} fc ON fc.filter = active.filter - WHERE fc.contextid = $context->id OR fc.contextid IS NULL"); + LEFT JOIN {filter_config} fc ON fc.filter = active.filter AND fc.contextid = $context->id"); // Masssage the data into the specified format to return. $filters = array();