Is there a way to perform a batch Load from a table in DynamoDB using the Global Secondary index?
The batchLoad API accepts only HashKeys, and the queryPage API only lets you pass in a single key.
DynamoDB supports two types of secondary indexes: Global secondary index — An index with a partition key and a sort key that can be different from those on the base table. A global secondary index is considered "global" because queries on the index can span all of the data in the base table, across all partitions.
To add a global secondary index to an existing table, use the UpdateTable operation with the GlobalSecondaryIndexUpdates parameter. You must provide the following: An index name. The name must be unique among all the indexes on the table.
No, you cannot update items in a GSI. You make changes/updates to items in the table and those updates are propagated to the GSIs.
BatchLoad uses BatchGetItem behind the scenes. BatchGetItem can only read from the base table, and not from indexes (LSI, GSI). Therefore, you will need to run multiple Query operations in parallel on your GSI to achieve a similar effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With