Skill 1.3.3
Describe differences between query and scan operations
Key Concepts
A Query requires a partition key value and can add a sort key condition such as begins_with or BETWEEN. It reads only the items in that partition, so it is fast and cheap. A Scan examines every item in the table or index and consumes capacity for all of them, which becomes slow and expensive as the table grows.
Both return at most 1 MB per call and paginate with LastEvaluatedKey. A FilterExpression reduces what is returned but not what is read or paid for. If you need to scan, a parallel scan with several segments finishes faster, and a smaller page size (Limit) reduces the impact on production traffic.