Finding Unused Spaces
Sometimes, you want to know what is not being used. It's great to know what's getting most attention, but what about stagnant pages, or even entire spaces that are no longer active?
While viewing space activity can provide hints, it doesn't always provide enough detail. It is possible to find out this information directly from the database.
The following query identifies the last date on which content was modified in each space within a single Confluence instance:
SELECT spaces.spacename, MAX(content.lastmoddate) FROM content, spaces WHERE content.spaceid = spaces.spaceid GROUP BY spaces.spacename;
It returns a list of space names, and the last date and time at which any content was added or changed.
Alternatively, this query identifies spaces where the content hasn't changed since a specified date:
SELECT spaces.spacename, spaces.spacekey FROM content, spaces WHERE content.spaceid = spaces.spaceid GROUP BY spaces.spacename, spaces.spacekey HAVING MAX(content.lastmoddate) < '2006-10-10';
The result is a simple list of space names and corresponding space keys.