Over the past few weeks, we have heard a spate of complaints about TFS database being bloated with test data and growing in size rapidly with time. Running tests regularly generates different kinds of data in your TFS database, primary categories being:
After analyzing several customer TFS databases, we realized that 1 was contributing to a significant chunk of the data being accumulated in the TFS database - anywhere from 30% to 80% of all test data. Most users did not however want these binaries in TFS since the rerun operation was very rarely done. Given this, we released a QFE last week, that would stop uploading these deployment binaries into TFS every time a test run is published into TFS: Team Foundation Server 2010 Service Pack 1: Reduce the size of the test data saved to the TFS database
More details on the specifics of the fix are in the KB article from where you can also download the hotfix by simply typing out your email ID where you will receive the hotfix link. Sweet! I tried this with my mail id and here is the link I was sent.
To deal with the remaining test data though, we recommend running the Test Attachment Cleaner to routinely clean up the TFS database of unwanted or stale data. The tool is recommended to be run on the application tier of your TFS and has several modes that it can be executed in - see the description here for more details on the tool. The tool generates a whole lot of database records when you clean up your database and we recently learnt of a couple of SQL bugs that would cause these deleted records to persist as ghosted records instead of getting cleaned up automatically. To address this, SQL shipped 2 fixes in their Cumulative update package 10 for SQL Server 2008 R2 - it is recommended you install this update on your TFS before running the test attachment cleaner. In addition, we are also working on reducing (either in space or the number of db records) other kind of test data published to TFS.
In the meantime, if you are experiencing growth in your test data size in TFS, please download and install this hotfix and send your comments my way :-)