如果您 运行 使用 AttributesToGet 参数对 DynamoDB 进行扫描,您是对每个项目的数据足迹收费还是仅对请求的属性收费?
If you run a scan on DynamoDB with an AttributesToGet argument are you charged for the data footprint of every item or just the requested attributes?
假设您 运行 在具有 1,000 个项目的 table 上使用以下代码,大小为 400KB,并假设 'column1' 的属性名称 + 实际数据为 10 字节:
import boto3
def getColumn1Items():
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('DynamoTable')
resp = table.scan(AttributesToGet=['column1'])
return resp['Items']
检索 1000 * 400 KB = 400 MB 的数据检索或通过 运行 执行此查询检索 1,000 * 10B = 10KB 的数据是否收费?
基于doc、
Note that AttributesToGet
has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
您需要为检索 400 MB 的数据付费。
另请注意,单个 Scan
请求最多可以检索 1 MB 的数据。因此,为了检索 400 MB 的数据,您需要多次请求。
假设您 运行 在具有 1,000 个项目的 table 上使用以下代码,大小为 400KB,并假设 'column1' 的属性名称 + 实际数据为 10 字节:
import boto3
def getColumn1Items():
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('DynamoTable')
resp = table.scan(AttributesToGet=['column1'])
return resp['Items']
检索 1000 * 400 KB = 400 MB 的数据检索或通过 运行 执行此查询检索 1,000 * 10B = 10KB 的数据是否收费?
基于doc、
Note that
AttributesToGet
has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
您需要为检索 400 MB 的数据付费。
另请注意,单个 Scan
请求最多可以检索 1 MB 的数据。因此,为了检索 400 MB 的数据,您需要多次请求。