Title: Most efficient Rally App SDK query and grouping of data
Tags: rally
Question: What is the most efficient way to get groupings of data using Rally App SDK? For example, looping through each project and each iteration to sum planned points.
1) Single query all stories and defects for all projects in scope, then loop through each project and group items. [1 query and lots of looping]
2) loop through each project and loop through each iteration, calling a query for the stories and defects for that project in that iteration. [many queries and a few loops]
3) some other method?

Here is the accepted answer: As a general rule server requests are slow and being a little more clever on the front end can result in performance increases.
I would probably try and query for all the iterations first. I would then create a huge OR'd query filtering stories and defects based upon that list of iterations.
That should keep your requested data to a minimum. If you can limit your iteration query to only have a certain StartDate or State that should help reduce the number of queries as well.
This is my best guess but without knowing how many iterations, stories and defects we are talking about.
Comment for this answer: I did try using recursive queries, but that doesn't work well since the callback functions are executed asynchronously.  So next I'll try the one big query.  It would be nice though to have a built in function(s) to sub-filter on result sets.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:04/13/12', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<rally>', 'Title': 'Most efficient Rally App SDK query and grouping of data', 'ViewCount': 421, 'id': 10147230, 'user_AboutMe': None, 'user_AccountId': 1117846.0, 'user_DisplayName': 'Michael Byers', 'user_Reputation': 233.0, 'user_Views': 33.0, 'user_id': 1106774.0}}