191k views
4 votes
What is a Global Secondary Index (GSI) used for in DynamoDB?

A) Storing primary key values
B) Accelerating queries on non-primary key attributes
C) Enforcing data consistency
D) Managing database backups

User Raj Peer
by
8.4k points

1 Answer

3 votes

Final answer:

A Global Secondary Index (GSI) in DynamoDB is used to accelerate queries on non-primary key attributes.

Step-by-step explanation:

A Global Secondary Index (GSI) in DynamoDB is used to accelerate queries on non-primary key attributes.

When you create a GSI, you can specify a set of attributes from the table to be projected into the index. This allows you to query the index directly using these attributes without the need to scan the entire table.

For example, if you have a table of books with attributes like title, author, and publication year, you can create a GSI on the author attribute. This will allow you to query the GSI to find all books by a specific author without having to scan the entire table.

User San Jay Falcon
by
7.3k points