First of all, thank you 4 the great work, you are awesome!
Then, i must create some queries to check some courses resources usage based on some sql filters, that's why i must use prefix_logstore_standard_log. But we have 6 digit students, so, the log is many gigabytes big.
But, when i use %%FILTER_COURSES, the coice is not saved and shows usage of all resources on all courses, and... crashes! <- (timeout)
Also, ¿where is the button to politelly write code?
SELECT mr.NAME as nomRecurs, mc.fullname as nomAula, COUNT(*) as visites
FROM moodle15.prefix_resource mr
INNER JOIN moodle15.prefix_course mc ON mr.course = mc.id
INNER JOIN moodle15.prefix_logstore_standard_log ml ON mc.id = ml.courseid
WHERE ml.component = 'mod_resource'
AND ml.action = 'viewed'
AND ml.target = 'course_module'
AND ml.objecttable = 'resource'
AND ml.origin = 'web'
AND ml.objectid = mr.id
GROUP BY ml.objectid