Created
June 24, 2014 12:43
-
-
Save sebdah/2adef69badcf36a1537f to your computer and use it in GitHub Desktop.
Updating throughput in DynamoDB global secondary indexes with boto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connection.update_table( | |
table_name='MailPostsExperimet', | |
global_secondary_index_updates=[ | |
{ | |
"Update": { | |
"IndexName": "gsiPosts", | |
"ProvisionedThroughput": { | |
"ReadCapacityUnits": 2, | |
"WriteCapacityUnits": 2 | |
} | |
} | |
} | |
] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [35]: table.describe() | |
Out[35]: | |
{u'Table': {u'AttributeDefinitions': [{u'AttributeName': u'Subject', | |
u'AttributeType': u'S'}, | |
{u'AttributeName': u'postDate', u'AttributeType': u'S'}, | |
{u'AttributeName': u'postId', u'AttributeType': u'N'}], | |
u'CreationDateTime': 1386880069.946, | |
u'GlobalSecondaryIndexes': [{u'IndexName': u'gsiPosts', | |
u'IndexSizeBytes': 204, | |
u'IndexStatus': u'ACTIVE', | |
u'ItemCount': 5, | |
u'KeySchema': [{u'AttributeName': u'postId', u'KeyType': u'HASH'}, | |
{u'AttributeName': u'Subject', u'KeyType': u'RANGE'}], | |
u'Projection': {u'ProjectionType': u'KEYS_ONLY'}, | |
u'ProvisionedThroughput': {u'ReadCapacityUnits': 1, | |
u'WriteCapacityUnits': 1}}], | |
u'ItemCount': 5, | |
u'KeySchema': [{u'AttributeName': u'postId', u'KeyType': u'HASH'}, | |
{u'AttributeName': u'postDate', u'KeyType': u'RANGE'}], | |
u'LocalSecondaryIndexes': [{u'IndexName': u'lsiPosts', | |
u'IndexSizeBytes': 244, | |
u'ItemCount': 5, | |
u'KeySchema': [{u'AttributeName': u'postId', u'KeyType': u'HASH'}, | |
{u'AttributeName': u'postDate', u'KeyType': u'RANGE'}], | |
u'Projection': {u'ProjectionType': u'ALL'}}], | |
u'ProvisionedThroughput': {u'LastDecreaseDateTime': 1387214748.435, | |
u'NumberOfDecreasesToday': 0, | |
u'ReadCapacityUnits': 1, | |
u'WriteCapacityUnits': 1}, | |
u'TableName': u'MailPostsExperimet', | |
u'TableSizeBytes': 244, | |
u'TableStatus': u'ACTIVE'}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment