Skip to content

Instantly share code, notes, and snippets.

@sebdah
Created June 24, 2014 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebdah/2adef69badcf36a1537f to your computer and use it in GitHub Desktop.
Save sebdah/2adef69badcf36a1537f to your computer and use it in GitHub Desktop.
Updating throughput in DynamoDB global secondary indexes with boto
connection.update_table(
table_name='MailPostsExperimet',
global_secondary_index_updates=[
{
"Update": {
"IndexName": "gsiPosts",
"ProvisionedThroughput": {
"ReadCapacityUnits": 2,
"WriteCapacityUnits": 2
}
}
}
]
)
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