How to find the total size of Attachments per space

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Data Center and Cloud By Request - This article was written for the Atlassian data center platform but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Purpose

If you are trying to identify 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 Dec 17, 2024

Was this helpful?

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