How to find the total size of Attachments per space

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

If you are trying to identify the where the majority of your attachments are located by space. This can be helpful when trying to audit attachments to reduce the size of a space export or even a backup with attachments. 

Solution

Run SQL query on the confluence database: 

select sum(cp.LONGVAL), s.spacename from spaces s INNER JOIN 
content c ON c.spaceid = s.spaceid INNER JOIN contentproperties cp 
ON cp.contentid = c.contentid where c.contenttype = 'ATTACHMENT' and 
cp.propertyname = 'FILESIZE' GROUP BY s.spacename;

The number returned is in bytes.

Last modified on Aug 19, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.