Querying Azure DocumentDB with ExecuteNextAsync returns fewer than MaxItemCount

江枫思渺然 提交于 2019-12-12 00:34:52

问题


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:


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.



来源:https://stackoverflow.com/questions/33120835/querying-azure-documentdb-with-executenextasync-returns-fewer-than-maxitemcount

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!