英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论