Question: How do you create an index in DynamoDB?

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Answer
Create a global secondary index (GSI) through the DynamoDB console, UpdateTable API or infrastructure as code. A local secondary index (LSI) can only be defined when the table is created; you cannot add one later.
Start with the query you need. Choose the GSI's partition and sort keys, attribute types and projection. KEYS_ONLY projects the keys, INCLUDE adds selected attributes, and ALL copies all attributes. Current GSIs also support multi-attribute keys; use a current SDK or tooling when configuring those.
For an existing table:
- Open the table's index-management view or prepare an
UpdateTablerequest. - Specify the GSI name, key schema and projection. On a provisioned table, configure sufficient index write capacity for backfill and ongoing writes.
- Create the index and monitor backfill progress, consumed capacity and throttling.
- Wait until the index is
ACTIVEbefore querying it withIndexName.
GSI reads are eventually consistent. A GSI contains only items with the required index-key attributes, and key-type violations can affect indexing. Adding an index also adds storage and write costs.
Dynobase table management supports GSI creation and backfill monitoring. See GSI design and LSIs vs GSIs before selecting an index type.
Source: AWS GSI management.
Other Common DynamoDB FAQ (with Answers)
- What are the differences between DynamoDB and Snowflake?
- What are the differences between DynamoDB and Google Bigtable?
- How do you access DynamoDB from an Android app?
- Is DynamoDB open source?
- Can Power BI connect to DynamoDB?
- Can you rename a DynamoDB table?
- How to access DynamoDB from EC2?
- Which programming language works best with DynamoDB?
- Can you store lists in DynamoDB?
- How is data stored in DynamoDB?
- What are the differences between DynamoDB and MySQL?
- What are the key differences between DynamoDB and Neo4j?
- Is DynamoDB based on MongoDB?
- Is connection pooling needed for DynamoDB?
- What is an access pattern in DynamoDB?
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today