question

ScottLee-0301 avatar image
0 Votes"
ScottLee-0301 asked ScottLee-0301 commented

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

I've read below link, but I wasn't clear if query results are limited by max degree of parallelism.
https://docs.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
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @ScottLee-0301 Welcome to the Microsoft Q&A forum, and thanks for reaching out.
We are checking internally with the product team we will get back to you once we get the response.

Regards
Geetha

0 Votes 0 ·
ScottLee-0301 avatar image ScottLee-0301 GeethaThatipatri-MSFT ·

Thanks for support.
I will be waiting for your help.

Regards,
Scott

0 Votes 0 ·

Hi
I was wondering if you have the answer.

Regards,
Scott

0 Votes 0 ·

1 Answer

Sajeetharan avatar image
0 Votes"
Sajeetharan answered ScottLee-0301 commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for answer.

0 Votes 0 ·