How do I determine the disk size of a SharePoint list?
Asked Answered
C

7

5

I have a list with roughly 5500 items, and I would like to find out the size on disk. Is there some way I can do this? I don't mind running a query in the database, if necessary.

Condiment answered 1/6, 2009 at 18:47 Comment(0)
B
6

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

Unfortunately, you can't get this report without turning on a site quota.

Bogan answered 1/6, 2009 at 21:56 Comment(1)
p.s. site quotas are a really good thing - it is amazing how fast unfettered users can upload documents.Douglassdougy
D
8

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

This will list the Storage Space Allocation for the site collection.

Douglassdougy answered 1/6, 2009 at 21:51 Comment(0)
B
6

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

Unfortunately, you can't get this report without turning on a site quota.

Bogan answered 1/6, 2009 at 21:56 Comment(1)
p.s. site quotas are a really good thing - it is amazing how fast unfettered users can upload documents.Douglassdougy
T
3

I could not get Tim Dobrinski's suggestion to work. This T-SQL query does not deal with everything, but gives a very good idea. Pop it into Excel, then add a column for "Size in MB" and add in a formula.

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')
Throes answered 10/11, 2010 at 21:54 Comment(1)
I used this but with a few tweaks. Since we have around a million items moving this to Excel and summing it there was out of the question. Instead I did a GROUP BY [dbo].[Lists].[tp_Title] and selected [dbo].[Lists].[tp_Title] AS "ListName", SUM([dbo].[Docs].[Size]/1024+[dbo].[Docs].[MetaInfoSize]/1024). This showed me how big each List was in KB. I then exported this to Excel and worked with it.Scoter
B
1

If you save the list in question as a template to the file system, this should give you a rough idea of its size. If you need to do this on a periodic basis this approach is not as useful.

Bebe answered 1/6, 2009 at 21:15 Comment(1)
This only works if the total size is less than 50mb.Belsky
G
1

Site Settings -> Storage Metrics

You can see how much each object is consuming, click on Lists to see each individual list

You don't have to set a site quota

Sharepoint 2013

Site settings

Goodbye answered 25/2, 2015 at 11:45 Comment(0)
B
0

This is taken from 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

It returns all lists of all webs, summing the size of the items and the attached documents. Document libraries are not included, use this:

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
Belsky answered 21/10, 2016 at 8:15 Comment(2)
Ack! Don't query the content DB directly!Condiment
The user wrote I don't mind running a query in the database, if necessary.Belsky
B
0

As Hussein Nasser said in this thread. This still relevant for SharePoint 2016 and Sharepoint 2019 (on-premise checked)

Being site collection admin, I went to Site Settings -> Storage Metrics and bingo...

If you have multiple lists, then click on Lists hyperlink, it will give you details info for each list.

How it looks

Bemire answered 16/8, 2023 at 11:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.