Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to batch reading mode to load revisions #29

Open
rjmurillo opened this issue Oct 14, 2015 · 0 comments
Open

Move to batch reading mode to load revisions #29

rjmurillo opened this issue Oct 14, 2015 · 0 comments

Comments

@rjmurillo
Copy link
Member

rjmurillo commented Oct 14, 2015

From Performance Tuning the Work Item Tracking Object Model

It is sometimes desirable to retrieve a specific set of WorkItems directly by ID if you know the IDs in advance. To do this, use the method in the following example. It takes in a batch collection that specifies the IDs and revisions of the desired WorkItems and a query string that specifies the Fields to page.

public WorkItemCollection Query(BatchReadParameterCollection batchReadParams, string wiql)

This method minimizes the round-trips used for a query, especially if the goal is to get a specific revision of each WorkItem. The following example specifies the series of calls in which you must specify IDs and revisions of work items.

  1. Run a query for the desired WorkItems. This returns a collection of the latest Revisions for the WorkItems.
  2. Open each WorkItem in the returned WorkItemCollection.
  3. For each WorkItem in the returned collection, open the desired Revision from its RevisionCollection.

Steps 1 and 2 earlier require round-trips to the server. For many WorkItems, the number of round-trips increases linearly.

By using the batch read version of the Query, the system returns the collection of specified work item revisions with a constant order of round-trips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants