How to get a unique list of all primary keys from a dynamo db table?

  Kiến thức lập trình

I’m running a scan on a table and it comes across the same PK multiple times. As advertised, it’s not very efficient.

I read somewhere that if I create a GSI on the PK and sort key that when I scan the index, it will be a unique list.

Before I try this out, does anybody know if that is the case?