本文介绍了带有“限制”的DynamoDB SCAN操作成本参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对AWS DynamoDB还是陌生的,并且已经阅读了文档,但我不确定100%确定在 SCAN 中使用' Limit '参数时成本计算会如何?

I'm pretty new to AWS DynamoDB and having read the documentation I'm not 100% sure what happens to cost calculations when using the 'Limit' parameter in a SCAN operation.

我知道应该设计表格,以便主要使用 QUERY 操作并进行 SCAN 将扫描整个表,从而消耗大量读取容量。我也知道FilterExpression不会影响扫描整个表的成本,但是会过滤整个扫描后 以及返回的扫描项总数是否超过最大数据集大小限制的返回值

I understand that one should design the tables so that QUERY operations are predominantly used and that a SCAN will scan the entire table, thus consuming a lot of read capacity. I also understand that a FilterExpression doesn't affect that cost of scanning the entire table, but filters what is returned after the entire scan, and if the total number of scanned items exceeds the maximum data set size limit of 1 MB, the scan stops and results are returned.

我不确定,是否为' Limit '参数是否为1 MB一种FilterExpression类型,或者是否停止整个扫描,从而降低读取成本。

What I'm not sure of, is whether the 'Limit' parameter is a type of FilterExpression, or whether it stops an entire scan, thus reducing read costs.

例如,如果我有一个活动表,其排序键是一个日期字段(updatedAt),它有一百万行。如果我以Limit = 10(为了获得最近的10个活动)执行SCAN,显然我会取回10行,但是读取一百万行会收取费用吗?成本是我最关心的问题。

For example, if I had an activity table with a sort key that is a date field (updatedAt) and it had a million rows. If I performed a SCAN with a Limit = 10 (in order to get the very latest 10 activities), I would obviously get back 10 rows but would I be charged for reading a million rows? Cost is my main concern.

推荐答案

是的,限制也会减少消耗的读取容量,这是 DynamoDB文档

Yes, Limit will also rediuce the consumed read capacity, here is the relevant part from the DynamoDB docs:

如您所见每个具有较小页面大小的扫描或查询请求都使用较少的读取操作

这篇关于带有“限制”的DynamoDB SCAN操作成本参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 06:50