From 16eaf7ed3519b3263f1a5066da465cbe56ab078f Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 13 Apr 2009 07:06:22 +0000 Subject: [PATCH] filters: MDL-7336 tweak to improve SQL performance --- lib/filterlib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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(); -- 2.39.5