ReadFeeds vs 查询 vs 在 CosmosDB 中读取
ReadFeeds vs Query vs Read in CosmosDB
我想验证一下我对 Cosmos DB (Cassandra API) 中 OperationType 的理解是否正确,因为我在文档中找不到很好的解释。
基本上我在 Cosmos DB 上有 运行 几个不同的案例,我发现当我使用分区键查询数据时,只使用 ReadFeed。但是当我不使用分区键时,就会使用 OperationType“查询”。这意味着显然在第一种情况下它不使用查询引擎并直接进入存储,而在第二种情况下使用查询引擎。听起来对吗?
根据 Microsoft 文档,分区键对于读取操作是必须的,但在使用查询操作时不是必需的,但也建议对查询操作使用分区键。
主要原因可能是因为在读操作中returns只有1项,所以不需要查询引擎,直接进入存储。
然而,在查询操作类型的情况下,它 returns 需要证明语句合理的查询引擎的无限项。
你可以参考这个doc了解ReadFeed和Query的区别。
阅读是当你Get a Document
The Get Document operation retrieves a document by its partition key and document key.
ReadFeed 是当你 List Documents
Performing a GET on the documents resource of a particular collection, i.e. the docs URI path, returns a list of documents under the collection. ReadFeed can be used to retrieve all documents, or just the incremental changes to documents within the collection.
查询是当你Query Documents(搜索)
You can query arbitrary json documents in a collection by performing a post against the “colls” resource in Cosmos DB.
ReadFeed 或更改提要是 Cosmos DB 的内部功能。其他数据库也维护更改提要。他们可能会公开它,您可以按照他们提供的方式与它互动。他们将在内部使用更改提要来处理很多事情。当您使用 ReedFeed 按分区过滤时,Cosmos DB 可能能够满足您的查询。
我想验证一下我对 Cosmos DB (Cassandra API) 中 OperationType 的理解是否正确,因为我在文档中找不到很好的解释。
基本上我在 Cosmos DB 上有 运行 几个不同的案例,我发现当我使用分区键查询数据时,只使用 ReadFeed。但是当我不使用分区键时,就会使用 OperationType“查询”。这意味着显然在第一种情况下它不使用查询引擎并直接进入存储,而在第二种情况下使用查询引擎。听起来对吗?
根据 Microsoft 文档,分区键对于读取操作是必须的,但在使用查询操作时不是必需的,但也建议对查询操作使用分区键。
主要原因可能是因为在读操作中returns只有1项,所以不需要查询引擎,直接进入存储。
然而,在查询操作类型的情况下,它 returns 需要证明语句合理的查询引擎的无限项。
你可以参考这个doc了解ReadFeed和Query的区别。
阅读是当你Get a Document
The Get Document operation retrieves a document by its partition key and document key.
ReadFeed 是当你 List Documents
Performing a GET on the documents resource of a particular collection, i.e. the docs URI path, returns a list of documents under the collection. ReadFeed can be used to retrieve all documents, or just the incremental changes to documents within the collection.
查询是当你Query Documents(搜索)
You can query arbitrary json documents in a collection by performing a post against the “colls” resource in Cosmos DB.
ReadFeed 或更改提要是 Cosmos DB 的内部功能。其他数据库也维护更改提要。他们可能会公开它,您可以按照他们提供的方式与它互动。他们将在内部使用更改提要来处理很多事情。当您使用 ReedFeed 按分区过滤时,Cosmos DB 可能能够满足您的查询。