问题
While performing a simple Get operation by Id where a single document is returned (not an array with one document) I get the following x-ms-resource-usage:
x-ms-resource-usage:documentSize:0;documentsSize:288;collectionSize=307;
Questions:
- Why is
documentSize
0? - What is the unit of measure? Bytes?
- What is the difference between
documentSize
anddocumentsSize
? Please note the query only returns one document. - What is the
collectionSize
? Is that the total number of documents in the collection? - What is the difference between
x-ms-resource-usage
andx-ms-resource-quota
?
回答1:
I'm fairly sure the numbers are as follows, and all in KB:
documentSize
: Size of the documentdocumentsSize
: Combined size of all documents in collectioncollectionSize
: Combined size of all documents in collection, along with overhead such as indexes
x-ms-resource-usage
is about consumed resources within the collection, while x-ms-resource-quota
is going to give you your limits. So with quota, you'll see documentsSize
and collectionSize
both set to something like 10485760, which is 10GB (10,485,760 MB).
回答2:
documentSize and documentsSize are the same value - first one in MB and the second one in kB. Apparently, documentSize is being deprecated.
collectionSize = documentsSize+metadata (in kB)
来源:https://stackoverflow.com/questions/35274760/understanding-the-x-ms-resource-usage-in-documentdb-response-header