Azure / Azure/azure-cosmosdb-java

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

Open
#250 2 comments 0 reactions 1 assignee Claimed by @mbhaskar View on GitHub
question
Dominant language
Java
Stars
59
Forks
68
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.