1 Answers
Hi Henry,
In that example, I was referring to being able to get an aggregate across all customers, so we would not need to include the customer id. We could just pull Period and TotalPurchases then add them up locally. The specific example in the AWS documentation uses a single row that’s updated frequently as a counter. This link might help explain it better:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-gsi-aggregation.html
–Scott
I don’t think GSI can do any aggregation by itself: query using GSI with a specific period will return all customer records in that period.