0
votes

I am querying an Azure DocumentDB collection using the FeedOption MaxItemCount to set the "page" size, and IDocumentQuery<T>::ExecuteNextAsync<T>(). When this is called with small values, say <100, against a set of 10,000 documents I consistently get back the number of objects I set as the limit.

However, when I execute with larger MaxItemCount values, say 500, I get back all manner of results, but never more than the MaxItemCount.

Now, I appreciate that MaxItemCount is a "max item count" but it was my understanding from the literature that the bounding factor was the number of objects in the collection. Something else is clearly limiting my results, and we can see the same behaviour in the Document Explorer and Query Explorer tools in the Azure Portal also.

The collection is set to "S3" which should support 2500RU and the Query Explorer shows a "cost" of less than 100RU.

Does anyone know what's going on here? What is constraining my result set?

1
Can you provide a minimal example that duplicates the problem? - Larry Maccherone
There are three things that constrain results: (1) the maximum response size of 1 MB. If this is reached, no more results are included in the batch (2) the throughput of the collection. If you reach the provisioned limit (with some buffer) based on S1/S2/S3, you might get fewer than the batch and (3) if you - Aravind Krishna R.
@LarryMaccherone Not easily. This is pretty fundamental to the service. Create a collection. Put anything you like in it - lots of documents with lots of properties. Ask for a page of 1000, get less. Restrict your query to fewer than all fields, get more rows. Eventually you can restrict your query to the point you get all 1000 rows. - Richard Hauer
@AravindRamachandran and (3) ??? We did suspect the 1MB limit (though I can't find that documented anywhere), however on at least one occasion we get a 12MB response which threw us a bit. - Richard Hauer
...reach the time limit of 5 seconds - this can happen if your query is a scan, for example if you have Property != Value. Like Larry mentioned, if you could provide more details, we can tell exactly what applies to your specific scenario. - Aravind Krishna R.

1 Answers

3
votes

There are limits for how long a query will execute on DocumentDB. These limits include the query's resource consumption (you can ballpark this w/ the amount of provisioned RU/sec * 5 sec + an undisclosed buffer), response size (1mb), and timeout (5 sec). If these limits are hit, then a partial set of results may be returned.