MDL-63785 core_repository: performance improvement

This commit is contained in:
Shamim Rezaie 2018-10-27 01:40:37 +11:00
parent d4269920de
commit 6b20a81cb4

View File

@ -109,15 +109,10 @@ class provider implements
return;
}
$params = [
'contextid' => $context->id,
'contextuser' => CONTEXT_USER,
];
$sql = "SELECT c.instanceid as userid
FROM {repository_instances} ri
JOIN {context} c ON c.instanceid = ri.userid AND c.contextlevel = :contextuser
WHERE c.id = :contextid";
$sql = "SELECT userid
FROM {repository_instances}
WHERE userid = ?";
$params = [$context->instanceid];
$userlist->add_from_sql('userid', $sql, $params);
}