big SQL query 

I just wrote an SQL query to find which accounts use the most storage space:

select * from (
select accounts.username, accounts.domain, sum(media_attachments.file_file_size) as media_size
from media_attachments
inner join accounts on (
group by order by media_size desc
) as t
where t.media_size is not null
limit 10;

to run it: "su postgres", then "psql mastodon_production", then type it in the shell

· · Web · 0 · 0 · 2
Sign in to participate in the conversation
Octodon is a mostly French-speaking Mastodon instance with an active moderation. est une instance Mastodon principalement francophone et avec une modération active.