We are having performance issues when using the COUNT function on a container with ~500,000 items.
This query...
SELECT VALUE COUNT(1) FROM c where c.batch = 'TestBatch'
...is slow, and returns a count of 438797, consuming 13438 RUs. I'm running this query using V3 of the Cosmos DB SDK, using a FeedIterator and passing in a single partition key.
I’ve noticed in a few other posts, mentions of a “V2” indexing policy, which apparently includes some significant performance improvements.
How can I check what version of the policy my database is using, and if it’s not V2, how can I upgrade to this?