When fetching all documents from Cosmos Db by a set of IDs, results are limited by max degree of parallelism?

ScottLee 21 Reputation points
2022-05-05T05:01:34.263+00:00

I've read below link, but I wasn't clear if query results are limited by max degree of parallelism.
https://learn.microsoft.com/en-us/answers/questions/129094/how-to-retrieve-a-set-of-documents-from-cosmos-db.html

I have collection with partition key /id, and I am trying to fetch documents by ids.

I am fetching documents by ids using javascript SDK like below

const joinedIds = "'" + ids.join("','") + "'";
const statement = SELECT * FROM c WHERE c.id IN (${joinedIds});
container.items.query(statement).fetchAll()

and my database settings are the followings

  • Page Options: unlimited
  • Enable cross-partition query: enabled
  • Max degree of parallelism: 6

My question is

If documents are distributed in more than 6 partitions,

Will fetchAll return all documents regardless of max degree of parallelism or number of result is limited by max degree of parallelism which is set to 6?

What is maximum value for maxDegreeOfParallelism?

Thanks in advance

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,528 questions
{count} votes

Accepted answer
  1. Sajeetharan 2,031 Reputation points Microsoft Employee
    2022-06-02T10:56:11.76+00:00

    When you use FetchAll, it fetches all documents in a container and it's not limited by MaxDegreeOfParallelism. There is no limit as such , this is a client side parallelism and it would cost your CPU / Memory resources that you have on your site.


0 additional answers

Sort by: Most helpful