Running Top 50 Largest Uploads
gives me says my biggest upload is less than 1mb, I know it’s wrong, so I explored and found them:
SELECT
uploads.original_filename,
ROUND(uploads.filesize / 1000000.0, 2) AS size_in_mb,
uploads.extension,
post_uploads.id,
upload_references.target_type,
upload_references.target_id
FROM uploads
LEFT JOIN post_uploads ON uploads.id = post_uploads.upload_id
LEFT JOIN upload_references ON uploads.id = upload_references.upload_id
ORDER BY uploads.filesize DESC
LIMIT 50
which finds, for example:
4.56 pdf NULL Post 4910
Which is strange: it has no post_uploads
, which is why it is not found by the original query, but has an upload_references
to a post.