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)
- Is DynamoDB HIPAA compliant?
- How to store location coordinates in DynamoDB?
- Does DynamoDB support load balancing?
- Is DynamoDB a memory store?
- Can QuickSight read DynamoDB?
- Is DynamoDB OLTP or OLAP?
- How to handle empty strings in DynamoDB?
- How to create an index in DynamoDB? (how to create an index in dynamodb)
- Can we pass objects as an item in DynamoDB?
- How to import data from S3 to DynamoDB?
- Which programming language works best with DynamoDB?
- Can colons and special characters be used in DynamoDB attributes?
- Why is DynamoDB better than MongoDB?
- Is DynamoDB based on MongoDB?
- How to write a test case for mocking DynamoDB?
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
DynamoDB Info
© 2026 Dynobase