Bird
0
0

Given a DynamoDB table with 1000 items, what will be the main difference in performance between these two operations?

medium📝 Predict Output Q13 of 15
AWS - DynamoDB
Given a DynamoDB table with 1000 items, what will be the main difference in performance between these two operations?
1. Query with KeyConditionExpression on partition key
2. Scan without any filter
ABoth read the same number of items and have similar speed
BScan reads fewer items and is faster; Query reads all items and is slower
CBoth read all items but Query is slower due to filtering
DQuery reads fewer items and is faster; Scan reads all items and is slower
Step-by-Step Solution
Solution:
  1. Step 1: Analyze Query operation

    Query uses the partition key to directly find matching items, reading fewer items and faster.
  2. Step 2: Analyze Scan operation

    Scan reads every item in the table, making it slower and more expensive.
  3. Final Answer:

    Query reads fewer items and is faster; Scan reads all items and is slower -> Option D
  4. Quick Check:

    Query = fewer reads, Scan = full table [OK]
Quick Trick: Query targets keys, Scan reads whole table [OK]
Common Mistakes:
  • Assuming Scan is faster than Query
  • Thinking Query reads all items
  • Ignoring cost differences

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes