Search⌘ K

Global Secondary Index

Explore how Global Secondary Indexes (GSIs) in DynamoDB allow querying data using different partition keys without scanning the entire table. Learn about GSIs creation, eventual consistency, resource implications, and attribute projection options to optimize your data retrieval.

There could be use cases when it’s necessary to look for information based on a partition key other than the one defined when a table is created. It could be a naive approach if we tried to get information by executing some type of scanning, as this would affect consumption and performance. To deal with these types of scenarios, DynamoDB gives us global secondary indexes (GSI).

Global Secondary Indexes

Global secondary indexes (GSIs) enable us to get records from a table without scanning it, or, at the very least, without looking for a partition key and comparing records that match particular criteria. These types of indexes seem similar to LSIs. However, they are different not only in the functionality they provide, but also ...