Question: Can a DynamoDB range key be a GSI key?

Answered by Rafal Wilinski
Answer
Yes, a DynamoDB range key can also be used as a GSI (global secondary index).It is common to use the same attribute as the range key and the GSI key. When you create a GSI, you can specify the range key attribute as the key to be indexed. This allows you to perform query operations on the range key attribute using the GSI and query and scan operations on the primary key attribute using the table.
Other Common DynamoDB FAQ (with Answers)
- What type of database is DynamoDB?
- How to access DynamoDB from outside?
- How to access DynamoDB from Android Studio?
- How to forcefully delete a DynamoDB table?
- Do I need a middleware for DynamoDB?
- Does sharding affect DynamoDB reads?
- How many DynamoDB tables can I have at a maximum?
- How does DynamoDB handle data changes?
- How do you store JSON on DynamoDB?
- Does DynamoDB have triggers?
- How to grab data from AWS DynamoDB?
- What is the maximum number of partitions in DynamoDB?
- What is the access pattern in DynamoDB?
- How to access DynamoDB from Apache Storm?
- How to dump multiple DynamoDB tables?
Better DynamoDB experience.
First 7 days are. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase