You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A client wanted a breakdown of where files are being stored and more details on the "other" mimetype. The below queries were used to help answer these questions.
I think this type of information is worth adding to the plugin.
Modules by data usage (all mimetypes):
SELECTc.idAS course_id,
c.fullnameAS course_name,
cm.idAS module_id,
m.nameAS module_name,
CONCAT('<a href="/mod/', m.name, '/view.php?id=', cm.id, '">Module Link</a>') AS module_link,
COUNT(f.id) AS file_count,
ROUND(SUM(f.filesize) /1024/1024/1024, 2) AS total_storage_gb
FROM
(SELECT DISTINCTON (contenthash) *FROM {files}) f
JOIN
{context} ctx ONf.contextid=ctx.idJOIN
{course_modules} cm ONctx.instanceid=cm.idJOIN
{modules} m ONcm.module=m.idJOIN
{course} c ONcm.course=c.idWHEREctx.contextlevel=70GROUP BYc.id, c.fullname, cm.id, m.nameORDER BY
total_storage_gb DESC
Modules by data usage (video):
SELECTc.idAS course_id,
c.fullnameAS course_name,
cm.idAS module_id,
m.nameAS module_name,
CONCAT('<a href="/mod/', m.name, '/view.php?id=', cm.id, '">Module Link</a>') AS module_link,
COUNT(f.id) AS video_file_count,
ROUND(SUM(f.filesize) /1024/1024/1024, 2) AS total_storage_gb
FROM
(SELECT DISTINCTON (contenthash) *FROM {files}) f
JOIN
{context} ctx ONf.contextid=ctx.idJOIN
{course_modules} cm ONctx.instanceid=cm.idJOIN
{modules} m ONcm.module=m.idJOIN
{course} c ONcm.course=c.idWHEREf.mimetypeLIKE'video/%'ANDctx.contextlevel=70GROUP BYc.id, c.fullname, cm.id, m.nameORDER BY
total_storage_gb DESC
Users by data usage (all mimetypes):
SELECTu.idAS user_id,
u.username,
CONCAT('<a href="/user/profile.php?id=', u.id, '">Profile Link</a>') AS user_profile_link,
COUNT(f.id) AS file_count,
ROUND(SUM(f.filesize) /1024/1024/1024, 2) AS total_storage_gb
FROM
(SELECT DISTINCTON (contenthash) *FROM {files}) f
JOIN
{user} u ONf.userid=u.idGROUP BYu.id, u.usernameORDER BY
total_storage_gb DESC
Users by data usage (video):
SELECTu.idAS user_id,
u.username,
CONCAT('<a href="/user/profile.php?id=', u.id, '">Profile Link</a>') AS user_profile_link,
COUNT(f.id) AS video_file_count,
ROUND(SUM(f.filesize) /1024/1024/1024, 2) AS total_storage_gb
FROM
(SELECT DISTINCTON (contenthash) *FROM {files} WHERE mimetype LIKE'video/%') f
JOIN
{user} u ONf.userid=u.idGROUP BYu.id, u.usernameORDER BY
total_storage_gb DESC
Data usage by mimetypes:
SELECTf.mimetype,
COUNT(f.id) AS file_count,
ROUND(SUM(f.filesize) /1024/1024/1024, 2) AS total_storage_gb
FROM
(SELECT DISTINCTON (contenthash) *FROM {files}) f
GROUP BYf.mimetypeORDER BY
total_storage_gb DESC
The text was updated successfully, but these errors were encountered:
A client wanted a breakdown of where files are being stored and more details on the "other" mimetype. The below queries were used to help answer these questions.
I think this type of information is worth adding to the plugin.
Modules by data usage (all mimetypes):
Modules by data usage (video):
Users by data usage (all mimetypes):
Users by data usage (video):
Data usage by mimetypes:
The text was updated successfully, but these errors were encountered: