Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

RU Discrepancy between Java Lib and Azure Portal for same query on Cosmos DB #250

Open 0xburn2 opened 5 years ago

0xburn2 commented 5 years ago

Hey guys

So I am trying to gather some RU data to figure out how to proceed with some implementation I'm working on.

This is the query I am running: SELECT TOP 1 * from c where c.field1= "id" OR c.field2 = "id" Field 1 is the primary key, and field 2 is indexed in the collection.

When I run this query from the Java lib enabling cross-partition queries, and accessing the RU in responseHeaders["x-ms-request-charge"] (response.requestCharge always shows 0.0 which might be another issue entirely) I see an average of 165-171 RUs per query

When I run this same exact query on the Azure Portal, I'm seeing an average of 2.9-3.5 RUs


What is the reason for this discrepancy? Is there a difference in how RU is calculated between the two methods above? Caching? Implementation error? Bug with the Java lib?

Thank you - hopefully somebody can help me get to the bottom of this.

christopheranderson commented 5 years ago

@mbhaskar - can you please take a look? Both the empty request charge and discrepancy in value. Ask @southpolesteve if you notice any funny business in the portal.

0xburn2 commented 5 years ago

Thanks @christopheranderson looking forward to an answer

@mbhaskar - can you please take a look? Both the empty request charge and discrepancy in value. Ask @southpolesteve if you notice any funny business in the portal.