How to query the database to find the size of all page drafts per space
プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。
要約
Confluence administrators may want to audit draft page usage on their instance.
ソリューション
The following query will identify the number of pages with a status of "draft" and the total size they take up in the database, per space:
select
count(content.contentid) as number_of_drafts,
pg_size_pretty(sum(pg_column_size(bodycontent.body))) as total_size_of_drafts,
spaces.spacename as space_name
from bodycontent
inner join content on (content.contentid = bodycontent.contentid)
inner join spaces on (content.spaceid = spaces.spaceid)
where bodycontent.contentid in
(select contentid from CONTENT where CONTENT_STATUS = 'draft' and CONTENTTYPE = 'PAGE')
GROUP BY space_name
ORDER BY number_of_drafts DESC, space_name;
The query above is written for PostgresSQL databases and may require adjustment for other platforms.
最終更新日 2020 年 4 月 11 日
Powered by Confluence and Scroll Viewport.