samson
samson

Reputation: 1607

how to get total row count in dynamodb?

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.

Upvotes: 1

Views: 7612

Answers (2)

Charles
Charles

Reputation: 23783

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

Upvotes: 0

F_SO_K
F_SO_K

Reputation: 14799

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

Upvotes: 3

Related Questions