I need your help to better understand how the RU/s calculation works on Cosmos DB, with Cassandra API.
I created a table with the following details:
CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 1 };
CREATE TABLE mykeyspace.data (
tenant_id text,
project_id text,
timestamp bigint,
metric_id text,
value double,
PRIMARY KEY ((tenant_id, project_id, metric_id), timestamp)
) WITH CLUSTERING ORDER BY (timestamp DESC);
I executed two different queries using the code suggested in https://docs.microsoft.com/it-it/azure/cosmos-db/find-request-unit-charge-cassandra to get "Request Charge" and obtained that:
1) "SELECT FROM mykeyspace.data WHERE metric_id='R15L2_lx_Msr_36_Id_1_15' AND project_id = '05dc67e7-4671-4d76-98d8-38354f1ec630' AND tenant_id = '5ee115749582159cdb' AND timestamp =1586960400000 LIMIT 1"
Request Charge=1.0*
2) "SELECT value FROM mykeyspace.data WHERE metric_id='R15L2_lx_Msr_36_Id_1_15' AND project_id = '05dc67e7-4671-4d76-98d8-38354f1ec630' AND tenant_id = '5ee115749582159cdb' AND timestamp =1586960400000 LIMIT 1"
Request Charge=4.1
Could you explain me why the second one had a higher charge?