MDL-62384 mod_quiz: Improve performancy of privacy queries
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 10 May 2018 06:42:22 +0000 (14:42 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Fri, 11 May 2018 01:15:29 +0000 (09:15 +0800)
mod/quiz/classes/privacy/provider.php

index 92f4b30..e3361cb 100644 (file)
@@ -148,7 +148,8 @@ class provider implements
             " . $qubaid->from . "
             WHERE (
                 qa.userid = :qauserid OR
             " . $qubaid->from . "
             WHERE (
                 qa.userid = :qauserid OR
-                " . $qubaid->where() . "
+                " . $qubaid->where() . " OR
+                qo.id IS NOT NULL
             ) AND qa.preview = 0
         ";
 
             ) AND qa.preview = 0
         ";