1 Answers
Hi divc12,
You’d want to use LSIs if you needed to query on a key combination that does not include your sort key. Take this record example:
{ "MachineID" : "Q123 "Operation" : "Finishing", "Date" : "2018-01-01" }
Let’s say you have setup MachineID as the partition key and Operation as the sort key. That works fine for most transactions you do. However, let’s say you want get the history of a MachineID on a specific Date. A Local Secondary Index would be used here, because otherwise, you’d need to do a Scan if you didn’t have the LSI available.
–Scott