# Storage usage

**URL:** https://meta.discourse.org/t/storage-usage/299248
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [March 13, 2024, 11:33pm UTC](https://meta.discourse.org/t/storage-usage/299248 "2024-03-13T23:33:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fuse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fuse/32/221005_2.png) [@fuse](https://meta.discourse.org/u/fuse)
#### Post date: [March 13, 2024, 11:33pm UTC](https://meta.discourse.org/t/storage-usage/299248/1 "2024-03-13T23:33:28Z")

</div>

Tried searching, didn’t find something similar.

Is there a way to generate a report of storage usage by user?

I run a very small discourse community- around 20 really active users, and around 40 total folks.

I bear the cost myself, which is fine.

I’d like to be able to do something like:

User A 1GB upload  
User B 10GB upload  
User C 100 GB upload

To have a relative reference on who is driving storage cost.

Any ideas?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [March 14, 2024, 4:32am UTC](https://meta.discourse.org/t/storage-usage/299248/2 "2024-03-14T04:32:58Z")

</div>

Would something like this fit the bill?

```sql
SELECT 
    user_id, 
    ROUND(SUM(filesize)/1048576.00,1) AS "Storage (MB)"
FROM uploads
GROUP BY user_id
ORDER BY 2 DESC
LIMIT 100

```

---

<div class="post-metadata">

### Author: ![fuse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fuse/32/221005_2.png) [@fuse](https://meta.discourse.org/u/fuse)
#### Post date: [March 14, 2024, 12:29pm UTC](https://meta.discourse.org/t/storage-usage/299248/3 "2024-03-14T12:29:23Z")

</div>

I will give it a try, thank you!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 14, 2024, 6:55pm UTC](https://meta.discourse.org/t/storage-usage/299248/4 "2024-03-14T18:55:52Z")

</div>

You could conceivably make a custom badge that used something like the suggested query to give people a badge when they hit each of the thresholds.
