gpt4 book ai didi

database - DynamoDB 计算操作容量单位消耗

转载 作者:搜寻专家 更新时间:2023-10-30 20:16:24 24 4
gpt4 key购买 nike

如果我没记错的话,要执行项目计数,在 DynamoDB 中我们必须使用 query操作并提供 Select: 'COUNT' 作为参数。让我们考虑一下,我想计算具有特定分区键的项目数。鉴于我们必须使用 query 操作,这是否意味着以下内容?:

  1. 即使我们只返回计数,消耗的读取容量单位将对应于所有项目的大小该分区键。
  2. 如果具有给定分区键的项的大小超过1MB,计数会偏,只会考虑最多的项目1MB,操作将分页。

最佳答案

对于您的两个问题,答案都是肯定的。

从文档中的这两点可以明显看出这一点:

  • CountScannedCount 的区别:

If you used a QueryFilter in the request, then Count is the number of items returned after the filter was applied, and ScannedCount is the number of matching items before the filter was applied.

If you did not use a filter in the request, then Count and ScannedCount are the same.

  • 事实上,DynamoDB 将 Count 视为另一个可以返回的属性:

You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.

关于database - DynamoDB 计算操作容量单位消耗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37678467/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com