mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-17038 - refine query to limit size of returned data.
Author: Peter Bulmer <peter.bulmer@catalyst.net.nz>
This commit is contained in:
parent
1500142bfb
commit
6ff7d16b25
@ -772,32 +772,28 @@ class auth_plugin_mnet extends auth_plugin_base {
|
|||||||
join("\n", $mnet_request->error));
|
join("\n", $mnet_request->error));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$query = "
|
||||||
$query = "SELECT
|
SELECT
|
||||||
l.id as remoteid,
|
mhostlogs.remoteid, mhostlogs.time, mhostlogs.userid, mhostlogs.ip,
|
||||||
l.time,
|
mhostlogs.course, mhostlogs.module, mhostlogs.cmid, mhostlogs.action,
|
||||||
l.userid,
|
mhostlogs.url, mhostlogs.info, mhostlogs.username, c.fullname as coursename,
|
||||||
l.ip,
|
c.modinfo
|
||||||
l.course,
|
FROM
|
||||||
l.module,
|
(
|
||||||
l.cmid,
|
SELECT
|
||||||
l.action,
|
l.id as remoteid, l.time, l.userid, l.ip, l.course, l.module, l.cmid,
|
||||||
l.url,
|
l.action, l.url, l.info, u.username
|
||||||
l.info,
|
FROM
|
||||||
c.fullname as coursename,
|
{user} u
|
||||||
c.modinfo as modinfo,
|
INNER JOIN {log} l on l.userid = u.id
|
||||||
u.username
|
WHERE
|
||||||
FROM
|
u.mnethostid = ?
|
||||||
{user} u,
|
AND l.id > ?
|
||||||
{log} l,
|
ORDER BY remoteid ASC
|
||||||
{course} c
|
LIMIT 500
|
||||||
WHERE
|
) mhostlogs
|
||||||
l.userid = u.id AND
|
INNER JOIN {course} c on c.id = mhostlogs.course
|
||||||
u.mnethostid = ? AND
|
ORDER by mhostlogs.remoteid ASC";
|
||||||
l.id > ? AND
|
|
||||||
c.id = l.course
|
|
||||||
ORDER BY
|
|
||||||
remoteid ASC";
|
|
||||||
|
|
||||||
$results = $DB->get_records_sql($query, array($mnethostid, $mnet_request->response['last log id']));
|
$results = $DB->get_records_sql($query, array($mnethostid, $mnet_request->response['last log id']));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user