Anthony Hocquet
Anthony Hocquet

Reputation: 348

Why my CosmosDB Count operation that exceeeds RU Throughput does not throttle?

I have a database with a shared Throughput of 400. This database contains two containers.

When I run the following query on one of these containers, I get charged for 1183 RUs :

SELECT VALUE COUNT(1) FROM c where c.GroupClaim = 'None'

GroupClaim is the partition key of the container.

How can a 1183 RUs query do not get rejected/throttled when I have a Throughput set to 400 ?

Here is a screen of my query stats :

Upvotes: 2

Views: 725

Answers (1)

David Makogon
David Makogon

Reputation: 71055

I can't explain why your query costs so much but... if you run a query that exceeds subscribed RU/sec, Cosmos DB will complete the query. But now you'll be "in debt" and you'll be throttled until your debt is paid off.

In your case, you're over the 400 by just over 700 (your debt), so you'll see the throttle time period be somewhere between 2 and 3 seconds (since you would have 1200 RU available over a 3-second period, per your service tier).

Upvotes: 3

Related Questions