1

In MySQL total number of rows found using "select count(*) from TABLENAME".

Similarly, how to get total number of rows in dynamodb table. using metrics is possible to know total number of rows.

2

2 Answers 2

3

If you just want to know the count, and don't need the number programmatically, go into the DynamoDB console, click on the table, and it will show you the item count

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

note the count shown is roughly 6hrs behind (fine print out the bottom) "live count" can be done to update the count...but it runs a scan and consumes RCU
0

If you don't mind a count that's roughly 6 hours behind, then Stu's answer works. IIRC, it's available programmatically also.

But if you want real-time counts, re-think your need for them ;)

If you really, really, need them, configure a DDB stream to a lambda that will update another DDB table (or a row in the table in question) with the record count and any other aggregate info you want to track. A GSI is often useful here as discussed in Using Global Secondary Indexes for Materialized Aggregation Queries

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.