- azure-cosmos:
- 4.16.0 and above:
- Windows 11:
- 3.14.5:
We are seeing a severe regression in azure-cosmos Python SDK 4.16.0 for single-partition COUNT queries.
Container:
- Container id: power_generation
- Partition key path: /documentType
- Partition key kind: Hash
Query:
SELECT VALUE COUNT(1) FROM c
SDK call:
query_items(
query="SELECT VALUE COUNT(1) FROM c",
partition_key="PowerCut",
enable_cross_partition_query=False,
populate_query_metrics=True
)
Results with azure-cosmos==4.15.0:
- Count: 30,735,986
- Elapsed: 0.049 sec
- Pages: 1
- RU: 8.82
- Continuation: None
- retrievedDocumentCount: 0
- retrievedDocumentSize: 0
- indexUtilizationRatio: 1.00
- Activity ID: 0899ada3-21d3-4273-9f83-ae075b91f69c
Results with azure-cosmos==4.16.0:
- Count: 30,725,812
- Elapsed: 191.923 sec
- Pages: 49
- Total RU: 506,961.75
- Continuation present for pages 1-48
- retrievedDocumentCount: ~626k per page
- retrievedDocumentSize: ~168 MB per page
- indexUtilizationRatio: 0.00
- Activity ID: 8a09c368-ce86-4fea-bd41-5240d24cbce6
Expected:
The query should remain an index-only count within the supplied logical partition, as in 4.15.0.
Actual:
4.16.0 scans/loads documents page-by-page and consumes extremely high RU.
We are seeing a severe regression in azure-cosmos Python SDK 4.16.0 for single-partition COUNT queries.
Container:
Query:
SELECT VALUE COUNT(1) FROM c
SDK call:
query_items(
query="SELECT VALUE COUNT(1) FROM c",
partition_key="PowerCut",
enable_cross_partition_query=False,
populate_query_metrics=True
)
Results with azure-cosmos==4.15.0:
Results with azure-cosmos==4.16.0:
Expected:
The query should remain an index-only count within the supplied logical partition, as in 4.15.0.
Actual:
4.16.0 scans/loads documents page-by-page and consumes extremely high RU.