Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boto's DynamoDB API returns wrong value when using item_count

I'm using the python framework Boto to interact with AWS DynamoDB. But when I use "item_count" it returns the wrong value. What's the best way to retrieve the number of items in a table? I know it would be possible using the Scan operation, but this is very expensive on resources and can take a long time if the table is quiet large.

like image 685
dr4ke616 Avatar asked Dec 03 '25 17:12

dr4ke616


1 Answers

The item_count value is only updated every six hours or so. So, I think boto is returning you the value as it is returned by the service but that value is probably not up to date.

like image 179
garnaat Avatar answered Dec 06 '25 07:12

garnaat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!