When using Azure Cosmos DB and querying one partition, i just specify the partition key in the FeedOptions. But when i have to query n partitions, i have (afaik) 2 options:
- Run a separate Task for every partition and merge the result in my application code
- Set the Flag "EnableCrossPartitionQuery" (along with MaxDegreeOfParallelism) in FeedOoptions and contrain my partitions in the query.
When i have to apply sort criteria along with paging on the whole result set (across all partitions) i think the first approach will reach it's limits.
What is the recommended way to query across multiple partitions in Cosmos DB using the .NET SQL API?