1
votes

I understand that to obtain document count, we should be using the following query: "SELECT VALUE COUNT(1) FROM c" But unfortunately, the 'Retrieved document size' will return 0 instead of the actual document size involved from Query Metric

If I now tweak the query to: "SELECT c.id FROM c", No doubt it will return me all the Ids. But this will also produce accurate, e.g.) 6738 bytes for my case. However, the draw back of this is that it will increase the "Output document size" unnecessary, and might not be feasible if many document is involved just to compute document size by query.

Is there anyway we can get Number of Document and Total Size of Document without reading the document and storing the size manually one by one?

Or, how can we get partition item count & partition total size? So that we can analyze the data and to restrict tenant usage?

1
I have provided some tips that I think can help you. I hope it can help you. If I have misunderstood or you need further help, please let me know. - Jason Pan
Has your issue solved ? - Jason Pan

1 Answers

0
votes

Based on your problem description, I tried it myself using Azure Cosmos DB Emulator. I haven't found the problem you described yet. It is recommended to check or try again to see if the problem can be solved.

My data:

enter image description here

Run query: SELECT VALUE COUNT(1) FROM c

enter image description here

You also can read this doucument, I think it useful to you.