使用ExecuteNextAsync查询Azure DocumentDB返回的数据少于MaxItemCount [英] Querying Azure DocumentDB with ExecuteNextAsync returns fewer than MaxItemCount

查看:90
本文介绍了使用ExecuteNextAsync查询Azure DocumentDB返回的数据少于MaxItemCount的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FeedOption MaxItemCount来设置页面"大小和IDocumentQuery<T>::ExecuteNextAsync<T>()来查询Azure DocumentDB集合.当以较小的值(例如< 100)调用此方法时,我将对一组10,000个文档始终取回设置为限制的对象数.

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.

但是,当我使用较大的MaxItemCount值(例如500)执行时,我会获得所有结果,但不会超过MaxItemCount.

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

现在,我很欣赏MaxItemCount是最大项目数",但是根据我的文献理解,限制因素是集合中对象的数量.显然有其他事情限制了我的结果,并且我们还可以在Azure门户的文档资源管理器和查询资源管理器工具中看到相同的行为.

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.

集合设置为"S3",应支持2500RU,并且查询资源管理器显示的费用"小于100RU.

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?

推荐答案

对于在DocumentDB上执行查询的时间有限制.这些限制包括查询的资源消耗(您可以用已配置的RU/秒的数量* 5秒+未公开的缓冲区来计算资源消耗),响应大小(1mb)和超时(5秒).如果达到这些限制,则可能会返回部分结果.

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.

这篇关于使用ExecuteNextAsync查询Azure DocumentDB返回的数据少于MaxItemCount的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆