1
votes

In the last two months we started using the vNext builds and releases (5 build/release definitions). This month we noticed an increase of the collection database (from ~5GB to 25GB).

I deleted and destroyed all builds of the XAML build definitions and I deleted all builds older than yesterday for the vNext build definitions.

Running the below SQL script:

select DATEPART(yyyy, CreationDate) as [year],
  DATEPART(mm, CreationDate) as [month],
  count(*) as [count],
  SUM(DATALENGTH(Content)) / 1048576.0 as [Size in Mb],
  (SUM(DATALENGTH(Content)) / 1048576.0) / count(*) as [Average Size]
from tbl_Content
group by DATEPART(yyyy, CreationDate),
    DATEPART(mm, CreationDate)
order by DATEPART(yyyy, CreationDate),
    DATEPART(mm, CreationDate)

shows an increase of the tbl_Content over the last two months: enter image description here

how can I reduce the database size? I tried already to shrink the SQL database/files.

TFS 14.102.25423.0 (Update 3)

SQL Server 12.0.4213.0

1

1 Answers

1
votes

In your scenario, the table grows a lot in May. So you need to check if there're many files check in to TFS, and if there're many builds runs in May.

To reduce the size of the tbl_Content table, you could refer to this blog: https://mattyrowan.com/2014/04/02/need-help-tfs-tbl_content-table-and-database-growth-out-of-control/

  1. Clean some old workspaces that you doesn't need any more.
  2. Run the tf destory command to delete those unnecessary source files permanently.
  3. Using TFS power tool to clean Test attachments and test results.