ScheuNZ
ScheuNZ

Reputation: 911

TFS 2015 slow to populate Incoming Requests after update

My organisation recently applied an update to TFS 2015 (14.102.25423.0 according to the 'About' page of the web interface) that resulted in the 'My Work' tab in Visual Studio 2015 taking up to one minute to populate. I played around with the queries and managed to narrow the problem down to population of the 'Incoming Requests' section of that tab. Under the hood, this is executing the following WIQL query.

SELECT [System.Id], [System.Links.LinkType], [System.Title], [System.State], [System.Reason], [System.AssignedTo] 
FROM WorkItemLinks 
WHERE (Source.[System.TeamProject] = @project and Source.[System.WorkItemType] in group 'Microsoft.CodeReviewRequestCategory' and Source.[System.AssignedTo] <> @me and Source.[Microsoft.VSTS.Common.StateCode] <> '1')
    and ([System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward') 
    and (Target.[System.WorkItemType] in group 'Microsoft.CodeReviewResponseCategory' and (Target.[System.AssignedTo] = @me or Target.[Microsoft.VSTS.Common.ReviewedBy] = @me) and Target.[Microsoft.VSTS.Common.StateCode] <> '2') 
ORDER BY [System.CreatedDate] desc, [System.Id] mode(MustContain)

Does anybody have any suggestions about what might be causing this slowness and what can be checked in order to narrow the performance problem down further?

Upvotes: 2

Views: 455

Answers (2)

ScheuNZ
ScheuNZ

Reputation: 911

Answering my own question here... My organisation ended up escalating this through Microsoft and eventually found that there was an issue with out of date statistics causing bad query plan generation. The query that was used to retrieve code review details was taking more than 60 seconds each time it was run.

The queries below will most likely make a significant different to performance if you encounter the same problem.

use <collection db name>;
UPDATE STATISTICS [dbo].[tbl_WorkItemCoreLatest] WITH FULLSCAN

use <collection db name>;
UPDATE STATISTICS [dbo].[tbl_WorkItemCustomLatest] WITH FULLSCAN

For reference, there's a duplicate of my original post on Microsoft Connect here: https://connect.microsoft.com/VisualStudio/Feedback/Details/3107261. The comments from Microsoft in this post indicate a number of people were seeing similar behaviour.

Upvotes: 0

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51183

The Team Explorer in Visual Studio provides a dropdown selector for specifying which state of code reviews one wants to list. The available choices are:

My Code Reviews and Requests (open)
My Code Reviews (open/mine)
Incoming Requests (open/others)
Recently Closed (closed)
Recently Finished (finished)

( Annotated each entry above with the state and ownership for clarity.)

According to the description of your performance issue, since this is occurring for all users, seems there are a large number of code reviews in your team. When you open the My work tab , the loading of the various code reviews cause a performance issue.

For this situation, you can try this workaroud: switch over to my code reviews in that Team Explorer drop down selector. After this, please double check whether the issue is gone or still exist.

Upvotes: 0

Related Questions