helpers
helpers mat 2 years ago 0%

Can I delete unused items from storage?

I'm behind on releases, I'm still on 2022.06. One thing preventing me upgrading is that I need to make a full backup for upgrading, but my database has blown up in size.

For me, the new storage table is pretty unfamiliar. But it seems to me that there's a lot of unused data there. Everything in storage must be either a photo or an attachment - right? I have 191433 rows in storage. I have 127206 rows in photo, and just one in attach. And it seems that the remaining rows are using 12GB, about half of the space of the whole DB:

MariaDB [friendica]> select count(*), sum(octet_length(storage.data)) from storage left outer join photo on storage.id = photo.`backend-ref` where photo.id is null;
+----------+---------------------------------+
| count(*) | sum(octet_length(storage.data)) |
+----------+---------------------------------+
|    63459 |                     13781405163 |
+----------+---------------------------------+

Am I right that I could just delete those rows (except for the single row in attach)?

0
0
Comments 0