我最近接手了管理 TFS 实例的职责,但我以前没有经验。在过去的 6 个月中,团队项目的数据库似乎变得异常大,阅读我能找到的所有内容帮助我(我认为)找出了罪魁祸首,但我不知道该怎么办。任何帮助,将不胜感激。
我已经运行了广泛可用的查询,例如:
SELECT TOP 3 o.name,
SUM(reserved_page_count) * 8.0 / 1024 SizeInMB,
SUM(CASE
WHEN p.index_id <= 1 THEN p.row_count
ELSE 0
END) Row_Count
FROM sys.dm_db_partition_stats p
JOIN sys.objects o
ON p.object_id = o.object_id
GROUP BY o.name
ORDER BY SUM(reserved_page_count) DESC
要找到这个:
name SizeInMB Row_Count
tbl_Content 313489.765625 10090278
tbl_Version 33400.828125 27518951
tbl_AggregateMap 10638.539062 32955145
还有这个其他查询:
SELECT Owner =
CASE
WHEN OwnerId = 0 THEN 'Generic'
WHEN OwnerId = 1 THEN 'VersionControl'
WHEN OwnerId = 2 THEN 'WorkItemTracking'
WHEN OwnerId = 3 THEN 'TeamBuild'
WHEN OwnerId = 4 THEN 'TeamTest'
WHEN OwnerId = 5 THEN 'Servicing'
WHEN OwnerId = 6 THEN 'UnitTest'
WHEN OwnerId = 7 THEN 'WebAccess'
WHEN OwnerId = 8 THEN 'ProcessTemplate'
WHEN OwnerId = 9 THEN 'StrongBox'
WHEN OwnerId = 10 THEN 'FileContainer'
WHEN OwnerId = 11 THEN 'CodeSense'
WHEN OwnerId = 12 THEN 'Profile'
WHEN OwnerId = 13 THEN 'Aad'
WHEN OwnerId = 14 THEN 'Gallery'
WHEN OwnerId = 15 THEN 'BlobStore'
WHEN OwnerId = 255 THEN 'PendingDeletion'
END,
SUM(CompressedLength) / 1024.0 / 1024.0 AS BlobSizeInMB
FROM tbl_FileReference AS r
JOIN tbl_FileMetadata AS m
ON r.ResourceId = m.ResourceId
AND r.PartitionId = m.PartitionId
WHERE r.PartitionId = 1
GROUP BY OwnerId
ORDER BY 2 DESC
寻找
Owner BlobSizeInMB
CodeSense 264426.749071121093
VersionControl 8728.462930678710
TeamTest 477.505887984375
ProcessTemplate 2.953623771484
FileContainer 0.024445533203
鉴于我们的代码,虽然 VersionControl = 8GB 似乎完全没问题,但 CodeSense 非常大。我没有在任何地方找到有关该功能的信息,或者如何禁用它。请帮忙!
PS:如果它与VS中的CodeLens功能有关,我们也没有使用它。