Understanding the x-ms-resource-usage in DocumentDB response header

吃可爱长大的小学妹 提交于 2019-12-19 19:48:24

问题


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 and documentsSize? 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 and x-ms-resource-quota?

回答1:


I'm fairly sure the numbers are as follows, and all in KB:

  • documentSize: Size of the document
  • documentsSize: Combined size of all documents in collection
  • collectionSize: 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!