Reputation: 3764
I know how to get the item count, but is there a way to determine the storage size of a table programatically?
In the console when you look at "Overview" of a table you can see the "Storage Size (in bytes)", it is that number I am after.
Upvotes: 0
Views: 1313
Reputation: 3770
Assuming you are asking for DynamoDb. You can try following:
from boto3 import resource
from boto3.dynamodb.conditions import Key
# The boto3 dynamoDB resource
dynamodb_resource = resource('dynamodb')
table = dynamodb_resource.Table(table_name)
bytes_size = table.table_size_bytes
Upvotes: 4