Home › Forums › AWS › AWS Certified DevOps Engineer Professional › Local vs global secondary indices – why is this answer correct? › Reply To: Local vs global secondary indices – why is this answer correct?
-
Hello Mason,
Thanks for your feedback.
Technically, a GSI with the LastPostDateTime as the sort key would work too. However, it is deemed as not the MOST suitable option because GSIs are usually used if you want to have a different partition key and sort key (optional), thus, the query will be ‘global’ because it’ll span across all partitions. Creating a GSI with the same partition key defeats its purpose of being ‘global’. Furthermore, you don’t need to recreate a DynamoDB table to create a GSI. You can create a GSI on an existing table.
Let me know if this answers your question.
Regards,
Carlo @ Tutorials Dojo