Recall & Review
beginner
What is a Global Secondary Index (GSI) in DynamoDB?
A GSI is an index with a partition key and optional sort key that can be different from the base table's keys. It allows querying data efficiently using alternate keys.
Click to reveal answer
beginner
How do you specify which GSI to query in a DynamoDB Query operation?
You specify the GSI name using the 'IndexName' parameter in the Query request to tell DynamoDB which index to use.
Click to reveal answer
beginner
Can you use Query on a GSI without specifying the partition key?
No. You must specify the partition key value for the GSI to perform a Query operation. Without it, DynamoDB cannot efficiently find matching items.
Click to reveal answer
intermediate
What is the difference between querying a base table and querying a GSI in DynamoDB?
Querying a base table uses the table's primary key, while querying a GSI uses the GSI's partition and optional sort key. The GSI can have different keys and projections.
Click to reveal answer
beginner
Why might you use a GSI instead of scanning a table in DynamoDB?
A GSI lets you query efficiently using alternate keys without scanning the whole table, which saves time and reduces read capacity usage.
Click to reveal answer
What parameter do you use to query a GSI in DynamoDB?
✗ Incorrect
You specify the GSI to query using the 'IndexName' parameter.
Which key must you always provide when querying a GSI?
✗ Incorrect
You must provide the partition key value of the GSI to query it.
What happens if you query a GSI without specifying its partition key?
✗ Incorrect
Query requires the partition key; without it, the query cannot find matching items.
Why use a GSI instead of scanning the whole table?
✗ Incorrect
GSI allows efficient queries on alternate keys without scanning the entire table.
Can a GSI have a different partition key than the base table?
✗ Incorrect
A GSI can have a different partition key and sort key than the base table.
Explain how to perform a Query operation on a Global Secondary Index in DynamoDB.
Think about what parameters you need to tell DynamoDB which index and keys to use.
You got /4 concepts.
Describe the benefits of using a Global Secondary Index instead of scanning a DynamoDB table.
Consider how indexes help find data faster.
You got /4 concepts.