Confused with clustered index #193
-
Thanks for this awesome library. I'm trying to decide if I shall use As the document said, the Could you give some examples of how the key will look with
The queries look the same for both
Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I @Derek-X-Wang 👋 Index types ultimately impact how the sort key is structured, which impacts how the values are stored in DynamoDB. In DynamoDB, items stored in the order of how their sort key sorts (duh, I know haha). As a result though, if you're trying to perform a partial query to retrieve multiple entities (a "collection" of entities), the results you get returned to you come back in this order as well. This isn't a problem if the items under your partition key can be retrieved in a single query -- however if your partition key has many items, and represent many entities, then it becomes important to consider how your items sort within your partition key. Should they be grouped together or mixed in with one another. The effect of index type becomes visible in the sort key when you at least one sort key composite attribute. Here's what I mean using the examples you provided:
Where the |
Beta Was this translation helpful? Give feedback.
I @Derek-X-Wang 👋
Index types ultimately impact how the sort key is structured, which impacts how the values are stored in DynamoDB. In DynamoDB, items stored in the order of how their sort key sorts (duh, I know haha). As a result though, if you're trying to perform a partial query to retrieve multiple entities (a "collection" of entities), the results you get returned to you come back in this order as well. This isn't a problem if the items under your partition key can be retrieved in a single query -- however if your partition key has many items, and represent many entities, then it becomes important to consider how your items sort within your partition key. Should they be grouped toge…