你可以添加一个全局二级索引表已创建后dynamodb? [英] Can you add a global secondary index to dynamodb after table has been created?

查看:534
本文介绍了你可以添加一个全局二级索引表已创建后dynamodb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用现有的dynamodb表,是​​否有可能修改表中添加一个全局二级索引?从dynamodb控制面板,它看起来像我不得不删除表,并创建一个新的全球指数。

解决方案

修改(2015年一月):你现在可以做到这一点。请参阅<一href="https://aws.amazon.com/blogs/aws/amazon-dynamodb-update-online-indexing-reserved-capacity-improvements/"相对=nofollow>这里


旧答:

没有,哈希键的表,范围键,索引不能在表创建后修改。您可以轻松地添加不在哈希键,范围键,或表创建索引之后元素的元素,虽然。

UpdateTable API文档:

  
    

您不能添加,修改或使用UpdateTable删除索引。索引只能在创建表时定义。​​

  

要在可能范围内,你应该试着预测当前和未来的查询需求,设计表和索引的相应。

您总是可以将数据迁移到新表,如果需要的话。

With an existing dynamodb table, is it possible to modify the table to add a global secondary index? From the dynamodb control panel, it looks like I have to delete the table and create a new one with the global index.

解决方案

Edit (January 2015): You can now do this. See here


Old Answer:

No, the hash key, range key, and indexes of the table cannot be modified after the table has been created. You can easily add elements that are not hash keys, range keys, or indexed elements after table creation, though.

From the UpdateTable API docs:

You cannot add, modify or delete indexes using UpdateTable. Indexes can only be defined at table creation time.

To the extent possible, you should really try to anticipate current and future query requirements and design the table and indexes accordingly.

You could always migrate the data to a new table if need be.

这篇关于你可以添加一个全局二级索引表已创建后dynamodb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆