本文介绍了在Cosmos DB中获取不同的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获得独特的价值.查询为SELECT DISTINCT c.Column1 FROM c.此查询在页面中而不是整个集合中使用与区别.如果我再次运行相同的上述查询,它将返回带有延续令牌的下一组不同的值.

I need to get the distinct value. The query is SELECT DISTINCT c.Column1 FROM c. This query applies distinct with in the page instead of the entire collection. If i run the same above query again, it returns the next set of distinct values with continuation Token.

我希望将独特的需求应用于整个集合,然后可以对结果进行分页.但是它在页面中与分别应用,并返回带有继续标记的结果.我想在不增加RU/s的情况下实现这一目标.

I want the distinct needs to be applied to the entire collection, then the results can be paged. But it applies distinct with in the page and returns the results with continuation token. I want to achieve this without increasing the RU/s.

推荐答案

cosmos db中的分页搜索针对查询性能进行了优化.页面大小也受Rus设置的限制.无论您的sql是否包含distinct,它最终都会扫描整个集合.此外,受RUs设置的限制,您无法一次遍历整个集合.

Paging-Search in cosmos db is optimized for query performance.Page size is also limited by Rus settings. Regardless of whether your sql contains distinct, it will eventually scan the entire collection. Furthermore, limited by RUs settings , you can't traverse the entire collection at once.

因此,即使必须先找到整个收藏集,也必须翻页.除非您将RUS设置为要避免的理想值.

So, even if you have to find the entire collection first, you have to page. Unless you set the RUS to the ideal value which is you tried to avoid.

希望它对您有帮助.

这篇关于在Cosmos DB中获取不同的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 18:45