DQL to find the count of documents in each folder location under /Cabinet/FolderA/FolderB.

Linked documents can definitely affect your folder count. Below is a modified version of your query to help identify where these linked documents might be located:

SELECT fdr.r_folder_path, COUNT(doc.r_object_id) as doccnt,
sum(doc.i_reference_cnt) as refcnt, sum(doc.r_full_content_size)/1024 as sizeKB
FROM dm_document (ALL) doc, dm_folder_r fdr
WHERE ANY doc.i_folder_id = fdr.r_object_id
AND fdr.r_folder_path like ‘/Temp%’
GROUP BY fdr.r_folder_path ORDER BY fdr.r_folder_path

result looks like:

The difference between doccnt and refcnt indicates folders where documents are linked. In this case, the /Temp and /Temp/Jobs/dm_Consistency Checker folders contain linked documents.

For more insight, the following query shows which documents are linked and the folders they are linked to:

Leave a Reply

Your email address will not be published. Required fields are marked *