DVA-C02 · Question #565
An application includes an Amazon DynamoDB table that is named orders. The table has a primary partition key of id and a global secondary index (GSI) that is named an accountIndex. The GSI has a…
The correct answer is D. Define a DynamoDB API request for the Query action with the following parameters. The Query action is the most efficient choice for this scenario. It retrieves items from a table or index based on the specified partition key (accountId) and can optionally use the sort key (orderDateTime) for additional filtering. By querying the accountIndex GSI with a…
Question
An application includes an Amazon DynamoDB table that is named orders. The table has a primary partition key of id and a global secondary index (GSI) that is named an accountIndex. The GSI has a partition key of accountId and a sort key of orderDateTime. A developer needs to create an AWS Lambda function to retrieve the orders that have an accountId of 100. Which solution will meet this requirement by using the LEAST read capacity?
Exhibits
Options
- ADefine a DynamoDB API request for the GetItem action with the following parameters:
- BDefine a DynamoDB API request for the BatchGetItem action with the following parameters:
- CDefine a DynamoDB API request for the Scan action with the following parameters:
- DDefine a DynamoDB API request for the Query action with the following parameters:
How the community answered
(30 responses)- A10% (3)
- B17% (5)
- C3% (1)
- D70% (21)
Explanation
The Query action is the most efficient choice for this scenario. It retrieves items from a table or index based on the specified partition key (accountId) and can optionally use the sort key (orderDateTime) for additional filtering. By querying the accountIndex GSI with a KeyConditionExpression, you directly retrieve only the relevant items without scanning unnecessary data, minimizing read capacity usage.
Community Discussion
No community discussion yet for this question.





