]> git.mjollnir.org Git - moodle.git/commitdiff
filters: MDL-7336 tweak to improve SQL performance
authortjhunt <tjhunt>
Mon, 13 Apr 2009 07:06:22 +0000 (07:06 +0000)
committertjhunt <tjhunt>
Mon, 13 Apr 2009 07:06:22 +0000 (07:06 +0000)
lib/filterlib.php

index 46caf2e4375a7d6b6a9f1f28e08fe9b8763ca76c..a0d5e2fb1bd14fe3d87ef693978119967c981a63 100644 (file)
@@ -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();