You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented your suggestion to pass the Response object in as the new configuration for the stored procedure when there's a continuation. My code looks like this now:
var roundtrips = 0;
var timer = Stopwatch.StartNew();
var configString = @"{
cubeConfig: {
groupBy: 'year',
field: 'Amount',
f: 'sum'
},
filterQuery: 'select * from TestLargeData t where t.Amount > 0'
}";
var config = JsonConvert.DeserializeObject<object>(configString);
Console.WriteLine($"Query #{roundtrips+1}...");
var result = await _client.ExecuteStoredProcedureAsync<dynamic>("dbs/foo/colls/bar/sprocs/baz", config);
roundtrips++;
while (result.Response["continuation"] != null)
{
// make a new config which is the entire response from the last call.
var nextConfig = JsonConvert.DeserializeObject(result.Response.ToString());
Console.WriteLine($"Query #{roundtrips + 1}...");
result = await _client.ExecuteStoredProcedureAsync<dynamic>("dbs/foo/colls/bar/sprocs/baz", nextConfig);
roundtrips++;
}
timer.Stop();
As of this writing my query is on round trip #123 and is taking about 11 seconds per trip.
As mentioned in the SO post, my collection has 1M records and a very simple structure:
Continued from this conversation: http://stackoverflow.com/questions/39669376/documentdb-stored-procedure-continuation
I implemented your suggestion to pass the Response object in as the new configuration for the stored procedure when there's a continuation. My code looks like this now:
As of this writing my query is on round trip #123 and is taking about 11 seconds per trip.
As mentioned in the SO post, my collection has 1M records and a very simple structure:
The collection is set up for 1000 RU's. The indexing policy on the collection is as follows:
Is there anything obviously wrong with what I'm doing here?
Thanks very much for your help, I appreciate it!
The text was updated successfully, but these errors were encountered: