DynamoDB扫描 – 具有相同分区键的项目按顺序返回

huangapple go评论50阅读模式
英文:

DynamoDB scan - are items with same partition key returned in order

问题

我知道DynamoDB的扫描不保证项目在整体上有序,但我想知道至少具有相同分区键的项目是否仍然按顺序返回?

例如,以下事件是否至少按顺序返回?

pk:customer-event / sk:1
pk:customer-event / sk:2
pk:customer-event / sk:3

我已经使用了一个小数据集进行了测试,似乎具有我想要的行为,但我不想假设行为。

英文:

I know DynamoDB scan doesn't guarantee ordering of items across the board but i wonder if atleast items with the same partition key still get returned in order?

For example would the following events atleast be returned in order?

pk:customer-event / sk:1
pk:customer-event / sk:2
pk:customer-event / sk:3

I have tested with a small dataset and it does seem to have the behaviour i'm after but i don't want to assume behaviour.

答案1

得分: 3

是的,这就是扫描的工作方式。PKs按照它们的哈希值顺序排列,然后SKs按照它们的真实值顺序排列。

英文:

Yes, that’s how scans work. The PKs are in the order of their hashed values, then SKs in the order of their true values.

huangapple
  • 本文由 发表于 2023年5月28日 03:38:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76348725.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定