DynamoDB 全局索引中的 ItemSize

ItemSize in DynamoDB Global Index

已经有一个关于如何计算the size of items in dynamodb tables 的问题。但是,根据我到目前为止阅读的文档,我不清楚如何计算全局索引查询返回的项目的项目大小。

是table中item的所有属性的大小还是仅投影到index中的item的所有属性的大小?

到目前为止,我找到了以下 material:

For Query and Scan operations, DynamoDB calculates the amount of consumed provisioned throughput based on item size, not on the amount of data that is returned to an application. For this reason, the number of capacity units consumed will be the same whether you request all of the attributes (the default behavior) or just some of them using the ProjectionExpression parameter. -- AWS Reference

For Query, all items returned are treated as a single read operation. As a result, DynamoDB computes the total size of all items and then rounds up to the next 4 KB boundary. -- AWS Reference

The data in a secondary index consists of attributes that are projected, or copied, from the table into the index. When you create a secondary index, you define the alternate key for the index, along with any other attributes that you want to be projected in the index. DynamoDB copies these attributes into the index, along with the primary key attributes from the table. You can then query or scan the index just as you would query or scan a table. -- AWS Reference

有谁知道答案吗?

它基于索引条目的大小。

来自 GSI Throughput Considerations documentation(强调我的):

For global secondary index queries, DynamoDB calculates the provisioned read activity in the same way as it does for queries against tables. The only difference is that the calculation is based on the sizes of the index entries, rather than the size of the item in the table. The number of read capacity units is the sum of all projected attribute sizes across all of the items returned; the result is then rounded up to the next 4 KB boundary. For more information on how DynamoDB calculates provisioned throughput usage, see Specifying Read and Write Requirements for Tables.