Ravi Sir's Cards › AWS
Query, not scan
This revision card explains Query, not scan. It starts from the need that reading the whole table is slow and costly. It describes query uses the partition key and a sort key range. The how-to section notes scan reads all items, then filters.
Read card text
What this card says
Why do we need it?
Reading the whole table is slow and costly.
What is it?
Query uses the partition key and a sort key range.
--key-condition-expression
How to do it
Scan reads all items, then filters.
ScannedCount
Example
Need a new pattern? Add a GSI and query it.