admin管理员组文章数量:1185673
From the dynamodb tables, I'm trying to get max sized item (top 3 with their ID) from the table. Is there a way that we can get the max sized item using scan or query. The table doesn't have any item size stored in a separate column
From the dynamodb tables, I'm trying to get max sized item (top 3 with their ID) from the table. Is there a way that we can get the max sized item using scan or query. The table doesn't have any item size stored in a separate column
Share Improve this question edited Jan 27 at 11:23 Harry asked Jan 27 at 11:21 HarryHarry 11 bronze badge1 Answer
Reset to default 1You can Scan the table, and run each item through an item calculator and keep a track of the largest items. If you use JS you can install this npm package:
https://www.npmjs.com/package/ddb-calc
You can easily build something in a different language if you do not use JS.
Another solution is to track the consumed WCU each time you insert or update an item, the larger the WCU consumed indicates the size of the item.
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#DDB-PutItem-request-ReturnConsumedCapacity
The same approach can be used for GetItem operations.
本文标签: how to find the max sized item from dynamodb tableStack Overflow
版权声明:本文标题:how to find the max sized item from dynamodb table? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738266154a2072049.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论