Bird
0
0

A developer uses Scan with a FilterExpression but notices high latency. What is the best way to improve performance?

medium📝 Debug Q7 of 15
AWS - DynamoDB
A developer uses Scan with a FilterExpression but notices high latency. What is the best way to improve performance?
AIncrease the table's read capacity units
BReplace Scan with Query using KeyConditionExpression
CAdd more FilterExpressions to Scan
DUse Scan with no filters
Step-by-Step Solution
Solution:
  1. Step 1: Identify cause of high latency

    Scan reads entire table, causing high latency especially with filters applied after reading.
  2. Step 2: Improve by using Query

    Query uses keys to directly access items, reducing read volume and latency.
  3. Final Answer:

    Replace Scan with Query using KeyConditionExpression -> Option B
  4. Quick Check:

    Query reduces latency by targeted reads [OK]
Quick Trick: Use Query for better performance over Scan [OK]
Common Mistakes:
MISTAKES
  • Adding more filters to Scan
  • Assuming increasing capacity fixes Scan inefficiency
  • Using Scan without filters to improve speed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes