27

Is it possible to add a new Local Secondary Index to an existing DynamoDB table?

1
  • 2
    Come on AWS give us this feature! Pretty please. Commented Aug 9, 2020 at 7:57

1 Answer 1

38

no, you cant do it, only adding global secondary index is possible to an existing table.

from documentation:

Local secondary indexes on a table are created when the table is created. 
Sign up to request clarification or add additional context in comments.

6 Comments

What if the design of the database changes or evolves with the same table? How do we handle that?
@kashyapjimuliya like how? do you have an example? you can always add/delete global secondary indexes
Like example, I have created two tables and for each there is LSI but when I want to add some new column to one of the tables and I want to make it as LSI for third table to have a One-to-One or One-to-Many relation. What I need to know is how is that scenario going to play out?
@kashyapjimuliya you can always add later secondary global index
but I want to use the same partition key for GSI as of table partition key. for this reason i needed LSI, since LSI is not possible, can i create GSI as such with same partition key
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.