azure - 在 Cosmos DB 中获取不同的值

标签 azure nosql azure-cosmosdb

我需要获得独特的值(value)。查询是SELECT DISTINCT c.Column1 FROM c。此查询适用于页面中的distinct with,而不是整个集合。如果我再次运行上述相同的查询,它将返回带有延续 token 的下一组不同值。

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

最佳答案

I want the distinct needs to be applied to the entire collection, then the results can be paged.I want to achieve this without increasing the RU/s.

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

因此,即使您必须首先找到整个集合,您也必须进行分页。除非您将 RUS 设置为您试图避免的理想值。

希望对您有帮助。

关于azure - 在 Cosmos DB 中获取不同的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51925526/

相关文章:

azure - 如何在 Azure Web 角色上设置 Apache Web 服务器

azure-cosmosdb - Gremlin客户管理

java - 我如何使用 zrangeByScore 在 SPRING-DATA-REDIS 中获取结果

c# - DocumentDb - 获取文档的 Json 表示

azure - 为什么 "path": "/\"_etag\"/?" is excluded from the excluded path in indexing policy of cosmosDB

azure - 尽管授予了权限,Graph API 仍不断返回 Authorization_RequestDenied

azure - Azure 表存储中跨多个表的事务

azure - Set-AzureRmDiagnosticSetting : Exception type: CloudException, 消息:不支持指标类别 'AllMetrics'

mongodb - 哪种 NoSQL DB 最适合 OLTP 金融系统?

cassandra - 如何仅使用分区键更新 cassandra 中的行?