How to determine the size of a SharePoint list?

I have a list with approximately 5500 items, and I would like to know the size on disk. Is there any way to do this? I do not mind running a query in the database, if necessary.

+3
source share
7 answers

If you enable site quotas, an option appears under the site settings Storage allocation . When you go to set a quota in the Central Administration, the page will inform you what is used in the current storage so that you can have an idea before that. Once you get to the Storage Allocation report , you can see the total size of the library.

Unfortunately, you cannot receive this report without including a site quota.

+7
source

Go to http: // [myapplication] / [mySitecollection] /_layouts/storman.aspx

This list will provide storage space for the site collection.

+6
source

, . , . . T-SQL- , . Excel, "Size in MB" .

USE [WSS_Content]
GO

SELECT
       [dbo].[Webs].[FullUrl]
      ,[dbo].[Lists].[tp_Title] AS "ListName"
      ,[dbo].[Docs].[DirName]
      ,[dbo].[Docs].[LeafName]
      ,[dbo].[Docs].[Size]
      ,[dbo].[Docs].[MetaInfoSize]
      ,[dbo].[Docs].[Version]
      ,[dbo].[Docs].[TimeCreated]
      ,[dbo].[Docs].[TimeLastModified]
      ,[dbo].[Docs].[MetaInfoTimeLastModified]
      ,[dbo].[Docs].[CheckoutUserId]
      ,[dbo].[Docs].[CheckoutDate]
      ,[dbo].[Docs].[ExtensionForFile]

  FROM [WSS_Content].[dbo].[Docs]
  INNER JOIN [WSS_Content].[dbo].[Webs] ON [dbo].[Webs].[Id] = [dbo].[Docs].[WebId]
  INNER JOIN [WSS_Content].[dbo].[Lists] ON [dbo].[Lists].[tp_ID] = [dbo].[Docs].[ListId]

  WHERE [dbo].[Docs].[Size] > 0     
  AND ([dbo].[Docs].[LeafName] NOT LIKE '%.stp')   
  AND ([dbo].[Docs].[LeafName] NOT LIKE '%.aspx')
  AND ([dbo].[Docs].[LeafName] NOT LIKE '%.xfp')
  AND ([dbo].[Docs].[LeafName] NOT LIKE '%.dwp')
  AND ([dbo].[Docs].[LeafName] NOT LIKE '%template%')
  AND ([dbo].[Docs].[LeafName] NOT LIKE '%.inf')
  AND ([dbo].[Docs].[LeafName] NOT LIKE '%.css')
+3

, . , .

+1

, .

. , . , . 1.5. , , .

+1

→

, , ,

Sharepoint 2013

Site settings

0

SharePoint 2013:

USE [WSS_Content_Intranet]
GO

SELECT 
    (ISNULL(DocSizes,0) + ISNULL(UserDataSize,0)) As TotalSize, 
    nLists.tp_ID,
    nLists.tp_Title,
    nLists.tp_ItemCount,
    Webs.FullUrl
FROM
    Webs
INNER JOIN
    (
    SELECT 
        ALAux.ItemCount as tp_ItemCount, 
        Lists.tp_Title, 
        Lists.tp_ID, 
        Lists.tp_WebID, 
        ALAux.Modified as tp_Modified, 
        Lists.tp_ServerTemplate, 
        Docs.DirName, 
        Docs.LeafName, 
        Lists.tp_ImageUrl
    FROM 
        Lists
    CROSS APPLY
        TVF_AllListsAux_NoLock_ListId(Lists.tp_SiteId, Lists.tp_ID) AS ALAux
    INNER JOIN 
        Docs
    ON 
        Lists.tp_RootFolder = Docs.Id AND 
        Lists.tp_WebId = Docs.WebId 
    WHERE 
        tp_BaseType <> 1 AND
        Lists.tp_SiteId = YOUR_SITE_ID
    ) As nLists
    ON
        Webs.Id = nLists.tp_WebId
    LEFT OUTER JOIN
        (
        SELECT 
            (SUM(CAST((ISNULL(Docs.Size,0)) AS BIGINT))) As DocSizes, 
            Docs.ListId,
            Docs.SiteId
        FROM 
            Docs 
        WHERE
            Docs.Type = 0 AND SiteId = YOUR_SITE_ID
        GROUP BY
            Docs.ListId,Docs.SiteId
        ) As DocsInList
        ON
            DocsInList.ListId = nLists.tp_ID
        LEFT OUTER JOIN
            (
            SELECT 
                (SUM(CAST((ISNULL(tp_Size,0)) AS BIGINT))) As UserDataSize, 
                tp_ListId 
            FROM
                UserData 
            GROUP BY 
                UserData.tp_ListId
            ) AS UserDataInList
            ON
                UserDataInList.tp_ListId = DocsInList.ListId
ORDER BY TotalSize DESC

-, . , :

SELECT
    Lists.tp_Title,
    Lists.tp_ID as Id,
    SUM(Docs.Size/1024 + Docs.MetaInfoSize/1024)/1024 AS SizeMB,
    COUNT(*) as NumberOfFiles
FROM dbo.Docs
    INNER JOIN Webs ON Webs.Id = Docs.WebId
    INNER JOIN Lists ON Lists.tp_ID = Docs.ListId
WHERE Docs.Size > 0
GROUP BY Lists.tp_Title,Lists.tp_ID
0
source

Source: https://habr.com/ru/post/1709544/


All Articles