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)
- How do you enable cloudtrail for DynamoDB?
- How resilient is DynamoDB?
- Are DynamoDB table names supposed to be unique?
- What does DynamoDB support?
- Is DynamoDB stateless?
- How to connect to DynamoDB?
- How do you store JSON on DynamoDB?
- Is DynamoDB multi-region?
- Is DynamoDB similar to MongoDB?
- How to create an index in DynamoDB? (how to create an index in dynamodb)
- Which AWS regions support DynamoDB?
- What type of database is DynamoDB?
- Why is DynamoDB easy to partition?
- Do I need a middleware for DynamoDB?
- Is DynamoDB columnar database?
Spend less time in the AWS console, use Dynobase.
Try 7-day free trial. No strings attached.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase