简体   繁体   English

如何在 AWS 管理控制台中查看 DynamoDB 查询结果计数

[英]How to see DynamoDB Query result count in AWS management console

i can see total item count in DynamoDB table in Overview tab, but when i query any DynamoDB table, I get results in AWS Management Console, with pagination at top right, but how to see total result count here?我可以在概览选项卡的 DynamoDB 表中看到总项目数,但是当我查询任何 DynamoDB 表时,我在 AWS 管理控制台中得到结果,在右上角有分页,但是如何在这里查看总结果数? I cant just paginate endlessly to see total count if resultset is huge.如果结果集很大,我不能无休止地分页以查看总数。

I also just wanted to see the total number of items in my DynamoDB using AWS Console and I want to share with anyone else coming here for the answer -我也只是想使用 AWS 控制台查看我的 DynamoDB 中的项目总数,我想与来这里寻求答案的其他人分享 -

  1. Open the DynamoDB for which you want to know the total items count.打开要了解其总项目数的 DynamoDB。
  2. Click the "Items" tab to see the list of items in the table, it shows first 100 items.单击“项目”选项卡以查看表中的项目列表,它显示前 100 个项目。
  3. Click the "Actions" drop-down and hit "Manage live count".单击“操作”下拉菜单,然后单击“管理实时计数”。

第1步

  1. A popup will appear with a button to "Start" the count.将出现一个带有“开始”计数按钮的弹出窗口。

第2步

In the new AWS console you can find it here: DynamoDb > Tables > Click on the table name > See the screenshot below .在新的 AWS 控制台中,您可以在此处找到它: DynamoDb > Tables > Click on the table name > See the screenshot below

在此处输入图像描述

There's no direct way to get the count of items in a DynamoDB table (there's no CLI method that returns count, for example).没有直接的方法来获取 DynamoDB 表中的项目计数(例如,没有返回计数的 CLI 方法)。 This is probably by design and therefore there's no way too see the count from the Console as well.这可能是设计使然,因此也无法从控制台看到计数。

However, you could use SELECT COUNT (similar to in a RDBMS) - this returns the count of records in a query - if you don't supply a FilterExpression this will effectively match all records and therefore give the total count.但是,您可以使用SELECT COUNT (类似于在 RDBMS 中)——这将返回查询中的记录计数——如果您不提供FilterExpression这将有效地匹配所有记录,从而给出总计数。

COUNT - Returns the number of matching items, rather than the matching items themselves. COUNT - 返回匹配项的数量,而不是匹配项本身。

In your Query you can set ReturnConsumedCapacity , for example在您的查询中,您可以设置ReturnConsumedCapacity ,例如

"ReturnConsumedCapacity": "TOTAL"

This will return the number of RCUs consumed in the Query, which is some cases will be the count of the items returned.这将返回查询中消耗的 RCU 数量,在某些情况下将是返回项目的数量。

Cases where this might not be true are where you are applying a filter to the result set.这可能不正确的情况是您将过滤器应用于结果集。 In this case, the RCUs will represent the pre-filtered set of items, not the number of items returned.在这种情况下,RCU 将代表预先过滤的项目集,而不是返回的项目数量。

So use it carefully, but in many cases this will work.所以小心使用它,但在许多情况下这会起作用。

EDIT: I just noticed you asked specifically about the console.编辑:我刚刚注意到您专门询问了控制台。 I don't know a way to do this in the console.我不知道在控制台中执行此操作的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM