问题描述
我对这两个二级索引以及它们之间的差异感到好奇。很难想象这是怎么回事。而且我认为,这将有助于更多的人而不仅仅是我。
I'm curious about these 2 secondary indexes and differences between them. It is hard to imagine how this looks like. And I think, this will help more people than just me.
推荐答案
本地二级索引仍然依赖于原始的哈希密钥。
当您提供具有散列+范围的表时,请将LSI视为散列+ range1,散列+ range2 ..散列+ range6。
您还可以再查询5个范围属性。
此外,只有一个预配置的吞吐量。
Local Secondary Indexes still rely on the original Hash Key.When you supply a table with hash+range, think about the LSI as hash+range1, hash+range2.. hash+range6.You get 5 more range attributes to query on.Also, there is only one provisioned throughput.
全局二级索引定义了一个新的范例 - 每个索引的不同散列/范围密钥。
这打破了每个表的一个散列键的原始用法。
这也是为什么在定义GSI时,您需要为每个索引添加预配置吞吐量并为其付费。
Global Secondary Indexes defines a new paradigm - different hash/range keys per index.
This breaks the original usage of one hash key per table.This is also why when defining GSI you are required to add a provisioned throughput per index and pay for it.
可以找到有关差异的更多详细信息在中
More detailed information about the differences can be found in the GSI announcement
这篇关于DynamoDB中本地和全局索引之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!