title: How to Shrink the TFS 2017 Fast Growing tbl_content Table
body: <p>We use TFS 2017 CI / CD pipelines, and it works great. However, the TFS 2017 databases grow averaging around 1GB per day. One database grows from 10GB to 44GB as of 10/23/2018. The growth slowly becomes unsustainable for us. We already adjusted retention policy to minimum. </p>
  
  <p>Researched and read at least 30 articles. Here are some relevant articles:</p>
  
  <p><a href="https://stackoverflow.com/questions/46232459/tfs-tbl-content-started-growing-very-fast-after-using-vnext-build">TFS tbl_Content started growing very fast after using VNext build</a></p>
  
  <p><a href="https://mattyrowan.com/2014/04/02/need-help-tfs-tbl_content-table-and-database-growth-out-of-control/" rel="nofollow noreferrer">https://mattyrowan.com/2014/04/02/need-help-tfs-tbl_content-table-and-database-growth-out-of-control/</a></p>
  
  <p><a href="https://developercommunity.visualstudio.com/content/problem/63712/tfs-database-size.html" rel="nofollow noreferrer">https://developercommunity.visualstudio.com/content/problem/63712/tfs-database-size.html</a></p>
  
  <p>Here are what I did so far:</p>
  
  <ol>
  <li><p>Reviewed again and again the retention policies, and reduced to minimum (1 day 1 copy). Adjusted 'Keep Deleted' for 10 days.</p></li>
  <li><p>Uncheck the 'Retain Build' box in release definition</p></li>
  <li><p>Run the scripts from three articles mentioned above, and found:</p>
  
  <p>a) FileContainer, has 149176 number of files, 43GB, (34GB compressed)</p>
  
  <p>b) FileContainerOwner: Build, 29GB </p></li>
  </ol>
  
  <p>So the main cause of the growth is Build (and artifacts).</p>
  
  <p>My question is how to shrink the database size down?</p>
  
  <p>I look at the tabs 'History' and 'Deleted' under build definitions.</p>
  
  <ol>
  <li><p>Some records in 'History' are locked with 'Retained by release'. I can click on records and delete. But it doesn't do anything. The records are still there.</p></li>
  <li><p>All records in 'Deleted' are still there. </p></li>
  </ol>
  
  <p>So back to my question again, how do I delete these records so that the space can be reclaimed? </p>
  
  <p>Thanks.</p>