exam questions

Exam AWS Certified Database - Specialty All Questions

View all questions & answers for the AWS Certified Database - Specialty exam

Exam AWS Certified Database - Specialty topic 1 question 318 discussion

Exam question from Amazon's AWS Certified Database - Specialty
Question #: 318
Topic #: 1
[All AWS Certified Database - Specialty Questions]

A company hosts an online gaming application on AWS. A single Amazon DynamoDB table contains one item for each registered user. The partition key for each item is the user's ID.

A daily report generator computes the sum totals of two well-known attributes for all items in the table that contain a dimension attribute. As the number of users grows, the report generator takes more time to generate the report.

Which combination of steps will minimize the time it takes to generate the report? (Choose two.)

  • A. Create a global secondary index (GSI) that uses the user ID as the partition key and the dimension attribute as the sort key. Use the GSI to project the two attributes that the report generator uses to compute the sum totals.
  • B. Create a local secondary index (LSI) that uses the user ID as the partition key and the dimension attribute as the sort key. Use the LSI to project the two attributes that the report generator uses to compute the sum totals.
  • C. Modify the report generator to query the index instead of the table.
  • D. Modify the report generator to scan the index instead of the table.
  • E. Modify the report generator to call the BatchGetItem operation.
Show Suggested Answer Hide Answer
Suggested Answer: AC 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
tsangckl
1 year, 1 month ago
Selected Answer: AC
A,C query faster then scan
upvoted 1 times
...
MultiAZ
1 year, 4 months ago
Selected Answer: AD
AD The daily report generator computes the "sum totals" of the attributes. In order to do this, you have to go over all the items (scan) and not query some of them.
upvoted 2 times
...
silvaa360
1 year, 5 months ago
Selected Answer: AD
Cannot query the index as you need to provide the partition key, and the use case needs to scan all items. The index will help because it will serve as a sparse index (only items with attribute) and at the same time having only two attributes reduces the size, thus also the size that the scan needs.
upvoted 2 times
...
roymunson
1 year, 7 months ago
Selected Answer: AC
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-query-scan.html
upvoted 1 times
...
JasonZhu
1 year, 7 months ago
Selected Answer: AD
A: By creating a GSI with the appropriate partition and sort keys, the report generator can efficiently query the index for the required attributes, minimizing the time required for calculations. D: It need to sum all the items with the dimension attribute, which means all items will be retrieved in the GSI table. So scan will be better than query.
upvoted 1 times
...
chen0305_099
1 year, 8 months ago
Selected Answer: AC
I Think AC
upvoted 1 times
...
aqiao
1 year, 8 months ago
Selected Answer: BC
Scan runs on table Query runs on index
upvoted 1 times
aqiao
1 year, 8 months ago
Changed to A,C since we can't add LSI to existing table : "Local secondary indexes are created at the same time that you create a table. You cannot add a local secondary index to an existing table, nor can you delete any local secondary indexes that currently exist." https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html
upvoted 2 times
...
...
zanhsieh
1 year, 9 months ago
Selected Answer: AC
B: No. An LSI is an index that is only spread across the same partition as the table, which can improve read performance for queries that scan a small number of items. In this case, the LSI will be scanned to compute the sum totals of the two attributes, so it is not as effective as creating a GSI. D: No, because scanning an index is not as efficient as querying an index. E: No, because the BatchGetItem operation is used to get multiple items from a table or index. The report generator only needs to get one item from the index, so the BatchGetItem operation would be overkill. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchGetItem.html
upvoted 3 times
...
tonyro2
1 year, 9 months ago
Selected Answer: BC
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LSI.html
upvoted 1 times
...
Windy
1 year, 10 months ago
The Answer: BE
upvoted 1 times
satya108
1 year, 9 months ago
Any Reason for BE.. any amazon doc for reference ??
upvoted 2 times
...
...
TQM__9MD
1 year, 10 months ago
Selected Answer: AE
By creating a GSI with the appropriate partition and sort keys, the report generator can efficiently query the index for the required attributes, minimizing the time required for calculations. Additionally, using the BatchGetItem operation allows the report generator to retrieve multiple items in a single request, further reducing the processing time. Therefore, the combination of steps A and E would help minimize the time taken for report generation in this scenario.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago